]> source.dussan.org Git - nextcloud-server.git/commitdiff
fixes potential passing of null to getUserGroupIds 23508/head
authorArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 16 Oct 2020 10:29:35 +0000 (12:29 +0200)
committerArthur Schiwon <blizzz@arthur-schiwon.de>
Fri, 16 Oct 2020 10:29:35 +0000 (12:29 +0200)
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
lib/private/Share20/DefaultShareProvider.php

index ecfe282dfbf26d08f79b499fd14fec61f96b4788..e43529086fd158d2061f4a17371e1461a3fa794d 100644 (file)
@@ -881,7 +881,7 @@ class DefaultShareProvider implements IShareProvider {
                        $cursor->closeCursor();
                } elseif ($shareType === IShare::TYPE_GROUP) {
                        $user = $this->userManager->get($userId);
-                       $allGroups = $this->groupManager->getUserGroupIds($user);
+                       $allGroups = ($user instanceof IUser) ? $this->groupManager->getUserGroupIds($user) : [];
 
                        /** @var Share[] $shares2 */
                        $shares2 = [];