diff --git a/lib/private/Share20/DefaultShareProvider.php b/lib/private/Share20/DefaultShareProvider.php index d349aa83491ea..e0a31a07011f0 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -330,6 +330,10 @@ public function acceptShare(IShare $share, string $recipient): IShare { throw new ProviderException('Group "' . $share->getSharedWith() . '" does not exist'); } + if (is_null($user)) { + throw new ProviderException('User "' . $recipient . '" does not exist'); + } + if (!$group->inGroup($user)) { throw new ProviderException('Recipient not in receiving group'); }