]> source.dussan.org Git - nextcloud-server.git/commitdiff
to return correct code when group not found 39537/head
authorAlexander Piskun <13381981+bigcat88@users.noreply.github.com>
Sat, 22 Jul 2023 10:18:43 +0000 (13:18 +0300)
committerAlexander Piskun <bigcat88@icloud.com>
Sat, 22 Jul 2023 10:18:43 +0000 (13:18 +0300)
Signed-off-by: Alexander Piskun <bigcat88@icloud.com>
apps/provisioning_api/lib/Controller/GroupsController.php

index e7e2a666b7bb40e8f8f05a0ee89f1ee767d4f598..46de5395a656021b554c7a86be8dbce7c63992bd 100644 (file)
@@ -271,6 +271,9 @@ class GroupsController extends AUserData {
 
                if ($key === 'displayname') {
                        $group = $this->groupManager->get($groupId);
+                       if ($group === null) {
+                               throw new OCSException('Group does not exist', OCSController::RESPOND_NOT_FOUND);
+                       }
                        if ($group->setDisplayName($value)) {
                                return new DataResponse();
                        }