From: Matthias Schmidt Date: Wed, 4 Mar 2015 19:00:10 +0000 (+0100) Subject: Improve UserGroupAssignmentHandler::checkUsers() X-Git-Tag: 2.1.2~96 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b51d60dbdfcfd6fad5fabe540f04365886d35c58;p=GitHub%2FWoltLab%2FWCF.git Improve UserGroupAssignmentHandler::checkUsers() --- diff --git a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php index e57889a0c1..e1754463f0 100644 --- a/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php +++ b/wcfsetup/install/files/lib/system/user/group/assignment/UserGroupAssignmentHandler.class.php @@ -64,12 +64,14 @@ class UserGroupAssignmentHandler extends SingletonFactory { } } - $userAction = new UserAction(array($user), 'addToGroups', array( - 'addDefaultGroups' => false, - 'deleteOldGroups' => false, - 'groups' => $newGroupIDs - )); - $userAction->executeAction(); + if (!empty($newGroupIDs)) { + $userAction = new UserAction(array($user), 'addToGroups', array( + 'addDefaultGroups' => false, + 'deleteOldGroups' => false, + 'groups' => $newGroupIDs + )); + $userAction->executeAction(); + } } }