Merge pull request #861 from ParsePlatform/fosco.role1

Fix for related query on non-existing column
This commit is contained in:
Fosco Marotto
2016-03-06 14:35:03 -08:00
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 {