From 6f78d29498e3e9619906f44b3271e85021e04368 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 21 Mar 2014 12:14:58 -0400 Subject: [PATCH] upgrade script should not delete non-hidden groups --- src/upgrade.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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();