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

View file

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