diff options
author | Kostiantyn Miakshyn <molodchick@gmail.com> | 2025-02-21 18:24:11 +0100 |
---|---|---|
committer | Kostiantyn Miakshyn <molodchick@gmail.com> | 2025-02-21 18:24:11 +0100 |
commit | 9bba153e4f49c1d17f85f0f634b259f016aa5a60 (patch) | |
tree | 9be8af49f262b8d271d062205e989ce80c0a9cbe | |
parent | 6cd30463699fda1dc0b9c2e99f497bdef56a293e (diff) | |
download | nextcloud-server-bugfix/fix-not-found-exception-for-anonymous-users.tar.gz nextcloud-server-bugfix/fix-not-found-exception-for-anonymous-users.zip |
Fix: NotFoundException for anonymous usersbugfix/fix-not-found-exception-for-anonymous-users
Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
-rw-r--r-- | apps/files_versions/lib/Listener/FileEventsListener.php | 6 |
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 |