Skip to content

Commit 6836b76

Browse files
ArtificialOwlbackportbot[bot]
authored andcommitted
fix: add notice on empty cachedPath
Signed-off-by: Anna Larch <anna@nextcloud.com>
1 parent 7b4052b commit 6836b76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

lib/FilesHooks.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,12 @@ private function getUnrelatedUsers(int $fileId, array $cachedMounts): array {
13591359
// now that we have a list of eventuals filtered users, we confirm they have no access to the file
13601360
$filteredUsers = [];
13611361
foreach ($usersToCheck as $userId) {
1362+
if (!array_key_exists($userId, $cachedPath) || $cachedPath[$userId] === null) {
1363+
$this->logger->notice('could not find user in list of cached path', ['cachePath' => $cachedPath, 'usersToCheck' => $usersToCheck, 'current' => $userId]);
1364+
$filteredUsers[] = $userId;
1365+
continue;
1366+
}
1367+
13621368
try {
13631369
$node = $this->rootFolder->get($cachedPath[$userId]);
13641370
if ($node->isReadable()) {

0 commit comments

Comments
 (0)