Merge pull request #109 from EagerIO/master

Fix bug where invalid relations in include filters would hang the server
This commit is contained in:
Raymond Feng 2014-05-13 11:30:09 -07:00
commit 98d5967be7
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]; var relation = relations[relationName];
if (!relation) { if (!relation) {
return function () { cb(new Error('Relation "' + relationName + '" is not defined for '
cb(new Error('Relation "' + relationName + '" is not defined for ' + self.modelName + ' model'));
+ self.modelName + ' model')); return;
};
} }
// Calling the relation method for each object // Calling the relation method for each object