Skip to content

Commit d760b03

Browse files
authored
Merge pull request #51001 from nextcloud/backport/50958/stable29
[stable29] Fix: NotFoundException for anonymous users
2 parents a547740 + 0360513 commit d760b03

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

apps/files_versions/lib/Listener/FileEventsListener.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,11 @@ private function getPathForNode(Node $node): ?string {
382382
}
383383
}
384384

385-
$owner = $node->getOwner()?->getUid();
385+
try {
386+
$owner = $node->getOwner()?->getUid();
387+
} catch (\OCP\Files\NotFoundException) {
388+
$owner = null;
389+
}
386390

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

0 commit comments

Comments
 (0)