mirror of
https://github.com/nextcloud/server.git
synced 2025-03-19 02:33:32 +00:00
fix: Also cleanup orphaned shares user cannot be found anymore
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
0da05fc73b
commit
9677ca062e
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue