aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2023-11-20 14:26:12 +0100
committerJulius Härtl <jus@bitgrid.net>2023-11-20 14:26:12 +0100
commit9677ca062ee9f8d960050866bd99ddf4818ff5d5 (patch)
tree30e4d5f7651c57a22562635edfea642a3e5886ab /apps
parent0da05fc73b720702b76d8838228f3ce648793482 (diff)
downloadnextcloud-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.php7
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;
}