From 0f7fad7166a97a1767a72d6a288027aaffeb65fb Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Sun, 18 Aug 2013 17:30:16 +0200 Subject: [PATCH] return only existing users in group --- lib/group/group.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/group/group.php b/lib/group/group.php index a752c4311c..c4ca7f1c0e 100644 --- a/lib/group/group.php +++ b/lib/group/group.php @@ -75,7 +75,10 @@ class Group { } foreach ($userIds as $userId) { - $users[] = $this->userManager->get($userId); + $user = $this->userManager->get($userId); + if(!is_null($user)) { + $users[$userId] = $user; + } } $this->users = $users; return $users; @@ -173,7 +176,10 @@ class Group { $offset -= count($userIds); } foreach ($userIds as $userId) { - $users[$userId] = $this->userManager->get($userId); + $user = $this->userManager->get($userId); + if(!is_null($user)) { + $users[$userId] = $user; + } } if (!is_null($limit) and $limit <= 0) { return array_values($users); @@ -205,7 +211,10 @@ class Group { $offset -= count($userIds); } foreach ($userIds as $userId) { - $users[$userId] = $this->userManager->get($userId); + $user = $this->userManager->get($userId); + if(!is_null($user)) { + $users[$userId] = $user; + } } if (!is_null($limit) and $limit <= 0) { return array_values($users);