From 31db0d78b13b1b664e3a868ae189f6375af3ecfb Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 30 Sep 2014 18:27:23 -0400 Subject: [PATCH] return empty array instead of undefined --- src/database/mongo/sets.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/database/mongo/sets.js b/src/database/mongo/sets.js index b6626e1c7c..ccd656aaf2 100644 --- a/src/database/mongo/sets.js +++ b/src/database/mongo/sets.js @@ -106,9 +106,10 @@ module.exports = function(db, module) { }; module.isSetMembers = function(key, values, callback) { - if (!key) { - return callback(); + if (!key || !Array.isArray(values) || !values.length) { + return callback(null, []); } + for (var i=0; i