Skip to content

Commit b3a1a4f

Browse files
authored
Merge pull request #1776 from nextcloud/feat/noid/log-on-no-user
notice on empty cachedPath
2 parents f85a916 + 76a03d2 commit b3a1a4f

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)