Merge pull request #109 from EagerIO/master
Fix bug where invalid relations in include filters would hang the server
This commit is contained in:
commit
98d5967be7
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue