diff options
author | Julius Härtl <jus@bitgrid.net> | 2023-11-20 14:26:12 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2023-11-20 14:26:12 +0100 |
commit | 9677ca062ee9f8d960050866bd99ddf4818ff5d5 (patch) | |
tree | 30e4d5f7651c57a22562635edfea642a3e5886ab /apps | |
parent | 0da05fc73b720702b76d8838228f3ce648793482 (diff) | |
download | nextcloud-server-9677ca062ee9f8d960050866bd99ddf4818ff5d5.tar.gz nextcloud-server-9677ca062ee9f8d960050866bd99ddf4818ff5d5.zip |
fix: Also cleanup orphaned shares user cannot be found anymore
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps')
-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; } |