Do not fail if groups don't exist
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
@@ -103,12 +103,15 @@ class ConfigController extends Controller {
|
|||||||
$groups = array_map(function($groupId) {
|
$groups = array_map(function($groupId) {
|
||||||
/** @var IGroup $groups */
|
/** @var IGroup $groups */
|
||||||
$group = $this->groupManager->get($groupId);
|
$group = $this->groupManager->get($groupId);
|
||||||
|
if ($group === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return [
|
return [
|
||||||
'id' => $group->getGID(),
|
'id' => $group->getGID(),
|
||||||
'displayname' => $group->getDisplayName(),
|
'displayname' => $group->getDisplayName(),
|
||||||
];
|
];
|
||||||
}, $groups);
|
}, $groups);
|
||||||
return $groups;
|
return array_filter($groups);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user