mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
fix fatal error when renaming group with no users
This commit is contained in:
@@ -295,7 +295,13 @@
|
||||
db.rename('group:' + oldName, 'group:' + newName, next);
|
||||
},
|
||||
function(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);
|
||||
|
||||
Reference in New Issue
Block a user