diff --git a/src/upgrade.js b/src/upgrade.js index 1b6b53c3fc..aa24a732c0 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -492,8 +492,8 @@ Upgrade.upgrade = function(callback) { function(next) { Groups.list({ showAllGroups: true }, function(err, groups) { async.each(groups, function(group, next) { - // If deleted, empty, or invalidly named hidden group, delete - if (group.deleted || group.memberCount === 0 || (group.hidden && !isValidHiddenGroup.test(group.name))) { + // If deleted, (hidden & empty), or invalidly named hidden group, delete + if (group.deleted || (group.hidden && group.memberCount === 0) || (group.hidden && !isValidHiddenGroup.test(group.name))) { Groups.destroy(group.name, next); } else { next();