Fix for related query on non-existing column

This commit is contained in:
Fosco Marotto
2016-03-06 00:34:44 -08:00
parent b3a52fb52c
commit 4ee9cb754c
2 changed files with 21 additions and 1 deletions

View File

@@ -89,7 +89,7 @@ DatabaseController.prototype.loadSchema = function(acceptor = returnsTrue) {
DatabaseController.prototype.redirectClassNameForKey = function(className, key) {
return this.loadSchema().then((schema) => {
var t = schema.getExpectedType(className, key);
var match = t.match(/^relation<(.*)>$/);
var match = t ? t.match(/^relation<(.*)>$/) : false;
if (match) {
return match[1];
} else {