fix fatal error when renaming group with no users

This commit is contained in:
root---
2014-07-31 01:39:41 -04:00
parent a0ded64394
commit f2d07d3182

View File

@@ -295,7 +295,13 @@
db.rename('group:' + oldName, 'group:' + newName, next);
},
function(next) {
db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next);
Groups.exists('group:' + oldName + ':members', function(err, exists) {
if (exists) {
db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next);
} else {
next();
}
});
},
function(next) {
renameGroupMember('groups', oldName, newName, next);