Skip to content

Commit

Permalink
Merge pull request #23508 from nextcloud/fix/23355/iuser-expected-nul…
Browse files Browse the repository at this point in the history
…l-given

fixes potential passing of null to getUserGroupIds
  • Loading branch information
MorrisJobke authored Oct 16, 2020
2 parents 4bf891f + fd23614 commit 09501e1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/private/Share20/DefaultShareProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public function getSharedWith($userId, $shareType, $node, $limit, $offset) {
$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 = [];
Expand Down

0 comments on commit 09501e1

Please sign in to comment.