fix leaders migrations when there are no other members

This commit is contained in:
Matteo Pagliazzi
2015-09-06 22:18:22 +02:00
parent ea477823f6
commit 15eef927a2

View File

@@ -29,7 +29,7 @@ dbGroups.findEach({}, {_id: 1, members: 1, leader: 1}, {batchSize: 500}, functio
if(err) throw err;
// If leader has deleted account
if(count < 1 && (group._id !== 'habitrpg')) {
if(count < 1 && (group._id !== 'habitrpg') && members && members[0]) {
dbGroups.update({
_id: group._id
}, {