From 6447e3b08e3718674a02b3f8434fb70fc70282a8 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Tue, 4 Aug 2026 11:44:13 +0200 Subject: [PATCH] fix(share): Prevent type error caused by non-existing user Signed-off-by: Carl Schwan --- lib/private/Share20/DefaultShareProvider.php | 4 ++++ 1 file changed, 4 insertions(+) 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'); }