Merge pull request #23514 from nextcloud/backport/23508/stable20

[stable20] fixes potential passing of null to getUserGroupIds
This commit is contained in:
Morris Jobke 2020-10-19 10:14:06 +02:00 committed by GitHub
commit cbde9d878f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View 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 = [];