Skip to content

Commit 62223af

Browse files
Merge pull request #51002 from nextcloud/backport/50958/stable30
[stable30] Fix: NotFoundException for anonymous users
2 parents 9fa48ae + 3012a87 commit 62223af

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

apps/files_versions/lib/Listener/FileEventsListener.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,11 @@ private function getPathForNode(Node $node): ?string {
359359
}
360360
}
361361

362-
$owner = $node->getOwner()?->getUid();
362+
try {
363+
$owner = $node->getOwner()?->getUid();
364+
} catch (\OCP\Files\NotFoundException) {
365+
$owner = null;
366+
}
363367

364368
// If no owner, extract it from the path.
365369
// e.g. /user/files/foobar.txt

0 commit comments

Comments
 (0)