From 6dac956cf8c1f8eee2197e0d83d8af9fde5335cb Mon Sep 17 00:00:00 2001 From: James Cooke Date: Wed, 23 Sep 2015 16:27:41 +0100 Subject: [PATCH] findByIds would fail when an array of 0 length was passed as its first argument --- lib/dao.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dao.js b/lib/dao.js index 35d4b82d..9ecb8b87 100644 --- a/lib/dao.js +++ b/lib/dao.js @@ -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; }