From 81a9034d13bf41b0af289f1c0ce5307abeb8b764 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 a9a5bd7903133..4ffa2dc033552 100644 --- a/lib/private/Share20/DefaultShareProvider.php +++ b/lib/private/Share20/DefaultShareProvider.php @@ -329,6 +329,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'); }