From d61c433072bb383cc748dcf5abb28e76f16a3163 Mon Sep 17 00:00:00 2001 From: Louis Chemineau Date: Wed, 4 Jun 2025 12:33:59 +0200 Subject: [PATCH] fix(FilesHooks): Catch all exceptions when looking up unrelated users This will catch "Undefined array key" exceptions from above `$cachedPath[$userId]`. Fix: https://github.com/nextcloud/groupfolders/issues/3680 Signed-off-by: Louis Chemineau --- lib/FilesHooks.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/FilesHooks.php b/lib/FilesHooks.php index cd85465e3..11d1d1b67 100644 --- a/lib/FilesHooks.php +++ b/lib/FilesHooks.php @@ -1398,7 +1398,7 @@ private function getUnrelatedUsers(int $fileId, array $cachedMounts): array { if ($node->isReadable()) { continue; // overkill ? as rootFolder->get() would throw an exception if file is not available } - } catch (\Exception $e) { + } catch (\Throwable $e) { } $filteredUsers[] = $userId;