Fix bug where invalid relations in include filters would hang the server

This commit is contained in:
Zack Bloom 2014-05-13 13:59:15 -04:00
parent d3fc157601
commit dd4089d1c7
1 changed files with 3 additions and 4 deletions

View File

@ -96,10 +96,9 @@ Inclusion.include = function (objects, include, cb) {
var relation = relations[relationName];
if (!relation) {
return function () {
cb(new Error('Relation "' + relationName + '" is not defined for '
+ self.modelName + ' model'));
};
cb(new Error('Relation "' + relationName + '" is not defined for '
+ self.modelName + ' model'));
return;
}
// Calling the relation method for each object