Skip to content

Commit

Permalink
Merge pull request #41643 from nextcloud/backport/41623/stable27
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusknorr authored Nov 24, 2023
2 parents b64de5e + ce9e5e6 commit 1f17dae
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion apps/files_sharing/lib/OrphanHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace OCA\Files_Sharing;

use OC\User\NoUserException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Files\IRootFolder;
use OCP\IDBConnection;
Expand All @@ -40,7 +41,11 @@ public function __construct(
}

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;
}
Expand Down

0 comments on commit 1f17dae

Please sign in to comment.