better check

v1.18.x
barisusakli 10 years ago
parent ec0624918f
commit 608943255b

@ -159,7 +159,7 @@ var async = require('async'),
}; };
Groups.isMember = function(uid, groupName, callback) { Groups.isMember = function(uid, groupName, callback) {
if (typeof uid !== 'string' && !parseInt(uid, 10)) { if (!uid || parseInt(uid, 10) <= 0) {
return callback(null, false); return callback(null, false);
} }
db.isSetMember('group:' + groupName + ':members', uid, callback); db.isSetMember('group:' + groupName + ':members', uid, callback);
@ -170,7 +170,7 @@ var async = require('async'),
}; };
Groups.isMemberOfGroups = function(uid, groups, callback) { 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;})); return callback(null, groups.map(function() {return false;}));
} }
groups = groups.map(function(groupName) { groups = groups.map(function(groupName) {

Loading…
Cancel
Save