From 608943255b40582a2046dee1e45e5ae17051b1f6 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 5 Nov 2014 16:42:32 -0500 Subject: [PATCH] better check --- src/groups.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/groups.js b/src/groups.js index 4168cdd7f1..787e520b5d 100644 --- a/src/groups.js +++ b/src/groups.js @@ -159,7 +159,7 @@ var async = require('async'), }; Groups.isMember = function(uid, groupName, callback) { - if (typeof uid !== 'string' && !parseInt(uid, 10)) { + if (!uid || parseInt(uid, 10) <= 0) { return callback(null, false); } db.isSetMember('group:' + groupName + ':members', uid, callback); @@ -170,7 +170,7 @@ var async = require('async'), }; Groups.isMemberOfGroups = function(uid, groups, callback) { - if (typeof uid !== 'string' && !parseInt(uid, 10)) { + if (!uid || parseInt(uid, 10) <= 0) { return callback(null, groups.map(function() {return false;})); } groups = groups.map(function(groupName) {