Group may be null if backend doesn't support creating groups

Signed-off-by: Dries Mys <dries.mys@my-dreams.be>
This commit is contained in:
Dries Mys 2021-06-01 01:11:21 +02:00
parent 4a51882793
commit 7a8e4c504b
1 changed files with 3 additions and 0 deletions

View File

@ -249,6 +249,9 @@ class GroupsController extends AUserData {
throw new OCSException('group exists', 102);
}
$group = $this->groupManager->createGroup($groupid);
if ($group === null) {
throw new OCSException('Not supported by backend', 103);
}
if ($displayname !== '') {
$group->setDisplayName($displayname);
}