From 4a4e82ae475bc231b88b6442fe4bfa20483997db Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 13 Sep 2024 13:34:49 -0100 Subject: [PATCH] fix: add notice on empty cachedPath Signed-off-by: Anna Larch --- lib/FilesHooks.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/FilesHooks.php b/lib/FilesHooks.php index 99c5763c0..668274c90 100644 --- a/lib/FilesHooks.php +++ b/lib/FilesHooks.php @@ -1359,6 +1359,12 @@ private function getUnrelatedUsers(int $fileId, array $cachedMounts): array { // now that we have a list of eventuals filtered users, we confirm they have no access to the file $filteredUsers = []; foreach ($usersToCheck as $userId) { + if (!array_key_exists($userId, $cachedPath) || $cachedPath[$userId] === null) { + $this->logger->notice('could not find user in list of cached path', ['cachePath' => $cachedPath, 'usersToCheck' => $usersToCheck, 'current' => $userId]); + $filteredUsers[] = $userId; + continue; + } + try { $node = $this->rootFolder->get($cachedPath[$userId]); if ($node->isReadable()) {