diff options
author | Arthur Schiwon <blizzz@owncloud.com> | 2015-11-05 11:50:57 +0100 |
---|---|---|
committer | Arthur Schiwon <blizzz@owncloud.com> | 2015-11-05 11:50:57 +0100 |
commit | 51ead4e59bc3695a2279758b0b410f3e2b5478e7 (patch) | |
tree | e36847b68a704b5cd8c53f9ce97cbf0f2ac58be6 /lib/private | |
parent | 6e7461f64caf8211f554e7e723d25a1b99b80bf8 (diff) | |
download | nextcloud-server-51ead4e59bc3695a2279758b0b410f3e2b5478e7.tar.gz nextcloud-server-51ead4e59bc3695a2279758b0b410f3e2b5478e7.zip |
subadmin methods should not return any null user or group
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/subadmin.php | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/private/subadmin.php b/lib/private/subadmin.php index c00a2b24669..c96275e3b87 100644 --- a/lib/private/subadmin.php +++ b/lib/private/subadmin.php @@ -119,7 +119,10 @@ class SubAdmin extends PublicEmitter { $groups = []; while($row = $result->fetch()) { - $groups[] = $this->groupManager->get($row['gid']); + $group = $this->groupManager->get($row['gid']); + if(!is_null($group)) { + $groups[] = $group; + } } $result->closeCursor(); @@ -141,7 +144,10 @@ class SubAdmin extends PublicEmitter { $users = []; while($row = $result->fetch()) { - $users[] = $this->userManager->get($row['uid']); + $user = $this->userManager->get($row['uid']); + if(!is_null($user)) { + $users[] = $user; + } } $result->closeCursor(); @@ -161,10 +167,14 @@ class SubAdmin extends PublicEmitter { $subadmins = []; while($row = $result->fetch()) { - $subadmins[] = [ - 'user' => $this->userManager->get($row['uid']), - 'group' => $this->groupManager->get($row['gid']) - ]; + $user = $this->userManager->get($row['uid']); + $group = $this->groupManager->get($row['gid']); + if(!is_null($user) && !is_null($group)) { + $subadmins[] = [ + 'user' => $user, + 'group' => $group + ]; + } } $result->closeCursor(); |