diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-11-24 13:25:13 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-24 13:25:13 +0100 |
commit | 1f17daed78ad77a1ffcbad166832e7bb24e8fb3f (patch) | |
tree | 48d1411bac6a5babc4dfbe22ee356b68eee58a18 | |
parent | b64de5e1b845b84b769e46b7c43b3a3171549306 (diff) | |
parent | ce9e5e655fac1cc141dec4757a113687f96efd51 (diff) | |
download | nextcloud-server-1f17daed78ad77a1ffcbad166832e7bb24e8fb3f.tar.gz nextcloud-server-1f17daed78ad77a1ffcbad166832e7bb24e8fb3f.zip |
Merge pull request #41643 from nextcloud/backport/41623/stable27
-rw-r--r-- | apps/files_sharing/lib/OrphanHelper.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/OrphanHelper.php b/apps/files_sharing/lib/OrphanHelper.php index 6d15680f882..e4fd062db3b 100644 --- a/apps/files_sharing/lib/OrphanHelper.php +++ b/apps/files_sharing/lib/OrphanHelper.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace OCA\Files_Sharing; +use OC\User\NoUserException; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\Files\IRootFolder; use OCP\IDBConnection; @@ -40,7 +41,11 @@ class OrphanHelper { } public function isShareValid(string $owner, int $fileId): bool { - $userFolder = $this->rootFolder->getUserFolder($owner); + try { + $userFolder = $this->rootFolder->getUserFolder($owner); + } catch (NoUserException $e) { + return false; + } $nodes = $userFolder->getById($fileId); return count($nodes) > 0; } |