Skip to content

Commit f235ffd

Browse files
Kocbackportbot[bot]
authored andcommitted
Fix: NotFoundException for anonymous users
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
1 parent a1f7480 commit f235ffd

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)