mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 08:55:47 +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);
|
db.rename('group:' + oldName, 'group:' + newName, next);
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
|
Groups.exists('group:' + oldName + ':members', function(err, exists) {
|
||||||
|
if (exists) {
|
||||||
db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next);
|
db.rename('group:' + oldName + ':members', 'group:' + newName + ':members', next);
|
||||||
|
} else {
|
||||||
|
next();
|
||||||
|
}
|
||||||
|
});
|
||||||
},
|
},
|
||||||
function(next) {
|
function(next) {
|
||||||
renameGroupMember('groups', oldName, newName, next);
|
renameGroupMember('groups', oldName, newName, next);
|
||||||
|
|||||||
Reference in New Issue
Block a user