From 990434476bb40c97e274df0dd8d9f4880c5edf05 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 29 Dec 2015 11:21:46 +0200 Subject: [PATCH] group.exists([]) fix --- src/groups.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/groups.js b/src/groups.js index e0e3c106fc..2da15aefa5 100644 --- a/src/groups.js +++ b/src/groups.js @@ -311,8 +311,8 @@ var utils = require('../public/src/utils'); return utils.slugify(groupName); }); async.parallel([ - function(next) { - callback(null, slugs.map(function(slug) { + function (next) { + next(null, slugs.map(function(slug) { return ephemeralGroups.indexOf(slug) !== -1; })); }, @@ -321,15 +321,14 @@ var utils = require('../public/src/utils'); if (err) { return callback(err); } - - callback(null, results.map(function(result) { - return result[0] || result[1]; + callback(null, name.map(function(n, index) { + return results[0][index] || results[1][index]; })); }); } else { var slug = utils.slugify(name); async.parallel([ - function(next) { + function (next) { next(null, ephemeralGroups.indexOf(slug) !== -1); }, async.apply(db.isSortedSetMember, 'groups:createtime', name)