diff --git a/lib/private/Group/Group.php b/lib/private/Group/Group.php index d8d1a73762ded..57289a4d3acb7 100644 --- a/lib/private/Group/Group.php +++ b/lib/private/Group/Group.php @@ -184,9 +184,7 @@ public function addUser(IUser $user): void { foreach ($this->backends as $backend) { if ($backend->implementsActions(\OC\Group\Backend::ADD_TO_GROUP)) { $backend->addToGroup($user->getUID(), $this->gid); - if ($this->users) { - $this->users[$user->getUID()] = $user; - } + $this->users[$user->getUID()] = $user; $this->dispatcher->dispatchTyped(new UserAddedEvent($this, $user));