From 8a84905e0fdfd424a3808d165cea2e57eec301b6 Mon Sep 17 00:00:00 2001 From: Maxence Lange Date: Fri, 13 Sep 2024 13:34:49 -0100 Subject: [PATCH] notice on empty cachedPath --- lib/FilesHooks.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/FilesHooks.php b/lib/FilesHooks.php index a10c21950..513ea2e1a 100644 --- a/lib/FilesHooks.php +++ b/lib/FilesHooks.php @@ -1384,6 +1384,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()) {