Browse Source

fix: Also cleanup orphaned shares user cannot be found anymore

Signed-off-by: Julius Härtl <jus@bitgrid.net>
tags/v28.0.0rc1
Julius Härtl 7 months ago
parent
commit
9677ca062e
No account linked to committer's email address
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      apps/files_sharing/lib/OrphanHelper.php

+ 6
- 1
apps/files_sharing/lib/OrphanHelper.php View File

@@ -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…
Cancel
Save