Check if groups is array, return empty do not throw

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2018-03-16 15:32:36 +01:00
parent f5137fef6c
commit 2493e9426d
No known key found for this signature in database
GPG Key ID: FB5ACEED51955BF8
1 changed files with 2 additions and 2 deletions

View File

@ -853,10 +853,10 @@ class UsersController extends OCSController {
public function getUserSubAdminGroups(string $userId): DataResponse { public function getUserSubAdminGroups(string $userId): DataResponse {
$groups = $this->getUserSubAdminGroupsData($userId); $groups = $this->getUserSubAdminGroupsData($userId);
if(!$groups) { if(is_array($groups)) {
throw new OCSException('Unknown error occurred', 102); throw new OCSException('Unknown error occurred', 102);
} else { } else {
return new DataResponse($groups);; return new DataResponse($groups);
} }
} }