Check if groups is array, return empty do not throw
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
parent
f5137fef6c
commit
2493e9426d
1 changed files with 2 additions and 2 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue