Skip to content

Commit 0926d62

Browse files
Merge pull request #62872 from nextcloud/carl/accept-share-hardening
fix(share): Prevent type error caused by non-existing user
2 parents 7a98f4d + 81a9034 commit 0926d62

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

lib/private/Share20/DefaultShareProvider.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,10 @@ public function acceptShare(IShare $share, string $recipient): IShare {
329329
throw new ProviderException('Group "' . $share->getSharedWith() . '" does not exist');
330330
}
331331

332+
if (is_null($user)) {
333+
throw new ProviderException('User "' . $recipient . '" does not exist');
334+
}
335+
332336
if (!$group->inGroup($user)) {
333337
throw new ProviderException('Recipient not in receiving group');
334338
}

0 commit comments

Comments
 (0)