findByIds would fail when an array of 0 length was passed as its first argument

This commit is contained in:
James Cooke 2015-09-23 16:27:41 +01:00
parent 4b16e3b0bd
commit 6dac956cf8
1 changed files with 1 additions and 1 deletions

View File

@ -909,7 +909,7 @@ DataAccessObject.findByIds = function(ids, query, options, cb) {
if (isPKMissing(this, cb)) {
return cb.promise;
} else if (ids.length === 0) {
process.nextTick(cb(null, []));
process.nextTick(function(){cb(null, []);});
return cb.promise;
}