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
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue