Do not fail if groups don't exist (#1033)

Do not fail if groups don't exist
This commit is contained in:
Julius Härtl
2019-05-08 13:18:12 +02:00
committed by GitHub

View File

@@ -103,12 +103,15 @@ class ConfigController extends Controller {
$groups = array_map(function($groupId) {
/** @var IGroup $groups */
$group = $this->groupManager->get($groupId);
if ($group === null) {
return null;
}
return [
'id' => $group->getGID(),
'displayname' => $group->getDisplayName(),
];
}, $groups);
return $groups;
return array_filter($groups);
}
}