Skip to content

Commit 472640f

Browse files
authored
Merge pull request #41644 from nextcloud/backport/41623/stable26
2 parents dc78056 + c1e015f commit 472640f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

apps/files_sharing/lib/OrphanHelper.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323

2424
namespace OCA\Files_Sharing;
2525

26+
use OC\User\NoUserException;
2627
use OCP\DB\QueryBuilder\IQueryBuilder;
2728
use OCP\Files\IRootFolder;
2829
use OCP\IDBConnection;
@@ -40,7 +41,11 @@ public function __construct(
4041
}
4142

4243
public function isShareValid(string $owner, int $fileId): bool {
43-
$userFolder = $this->rootFolder->getUserFolder($owner);
44+
try {
45+
$userFolder = $this->rootFolder->getUserFolder($owner);
46+
} catch (NoUserException $e) {
47+
return false;
48+
}
4449
$nodes = $userFolder->getById($fileId);
4550
return count($nodes) > 0;
4651
}

0 commit comments

Comments
 (0)