Skip to content

Commit

Permalink
Fix: NotFoundException for anonymous users
Browse files Browse the repository at this point in the history
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
  • Loading branch information
Koc committed Feb 21, 2025
1 parent 6cd3046 commit 9bba153
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion apps/files_versions/lib/Listener/FileEventsListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,11 @@ private function getPathForNode(Node $node): ?string {
}
}

$owner = $node->getOwner()?->getUid();
try {
$owner = $node->getOwner()?->getUid();
} catch (\OCP\Files\NotFoundException) {
$owner = null;
}

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

0 comments on commit 9bba153

Please sign in to comment.