Fix: NotFoundException for anonymous users

Signed-off-by: Kostiantyn Miakshyn <molodchick@gmail.com>
pull/51001/head
Kostiantyn Miakshyn 2025-02-21 18:24:11 +07:00 committed by backportbot[bot]
parent 77c9238892
commit 03605133d8
1 changed files with 5 additions and 1 deletions

@ -382,7 +382,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