Skip to content

Commit 6035b1e

Browse files
Merge pull request #445 from nextcloud/handle-notfound-owner
catch new notfound exception while trying to get owner
2 parents 45a11f9 + 795e8ae commit 6035b1e

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

lib/FilesHooks.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -635,8 +635,12 @@ protected function getUserPathsFromPath($path, $uidOwner) {
635635
*/
636636
protected function getSourcePathAndOwner($path) {
637637
$view = Filesystem::getView();
638-
$owner = $view->getOwner($path);
639-
$owner = !is_string($owner) || $owner === '' ? null : $owner;
638+
try {
639+
$owner = $view->getOwner($path);
640+
$owner = !is_string($owner) || $owner === '' ? null : $owner;
641+
} catch (NotFoundException $e) {
642+
$owner = null;
643+
}
640644
$fileId = 0;
641645
$currentUser = $this->currentUser->getUID();
642646

0 commit comments

Comments
 (0)