aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostiantyn Miakshyn <molodchick@gmail.com>2025-02-21 18:24:11 +0100
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2025-02-24 15:13:48 +0000
commit3012a87bacfb20009212e3647fe9c50062f093e2 (patch)
tree0aeaa747854af0c4cf070710c13d65f5825d4321
parentc4467ba1e40d013a0c352b4989c2409d56677a0c (diff)
downloadnextcloud-server-backport/50958/stable30.tar.gz
nextcloud-server-backport/50958/stable30.zip
Fix: NotFoundException for anonymous usersbackport/50958/stable30
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
-rw-r--r--apps/files_versions/lib/Listener/FileEventsListener.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/apps/files_versions/lib/Listener/FileEventsListener.php b/apps/files_versions/lib/Listener/FileEventsListener.php
index c078f4bc347..49150f4e726 100644
--- a/apps/files_versions/lib/Listener/FileEventsListener.php
+++ b/apps/files_versions/lib/Listener/FileEventsListener.php
@@ -359,7 +359,11 @@ class FileEventsListener implements IEventListener {
}
}
- $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