NodeBB/NodeBB — pull request #1928 by root--- (2014-07-31 05:55:15+00:00)
Title: fix fatal error when renaming group with no users

When a new group is created, a respective groups:groupName:members is not created until a new member is added.

When db.rename is executed on a new group, next is called with err set, so the last function in the async#series is not called. This will result in the database containing group:newName and oldName in the groups set.

Groups.get with then throw 'group-not-found' and callback with an erroneous results.base ([, undefined]), because db.getObject('group:' + groupName) will callback with an undefined groupObj, affecting functions such as Groups.list.