]> source.dussan.org Git - nextcloud-server.git/commitdiff
return only existing users in group
authorArthur Schiwon <blizzz@owncloud.com>
Sun, 18 Aug 2013 15:30:16 +0000 (17:30 +0200)
committerArthur Schiwon <blizzz@owncloud.com>
Mon, 19 Aug 2013 09:48:21 +0000 (11:48 +0200)
lib/group/group.php

index a752c4311c1f0ffbdfd97d589dd5c69dc0984c71..c4ca7f1c0eb3090c52fce7ef1edfc462ea18ca4e 100644 (file)
@@ -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);