Skip to content

Commit

Permalink
remove no longer accessible shares
Browse files Browse the repository at this point in the history
Signed-off-by: Robin Appelman <[email protected]>
  • Loading branch information
icewind1991 committed Jul 5, 2023
1 parent c7ea6ce commit e80c64d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apps/files_sharing/lib/SharedStorage.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,7 @@ private function init() {
/** @var Node|false $ownerNode */
$ownerNode = current($ownerNodes);
if (!$ownerNode) {
$this->storage = new FailedStorage(['exception' => new NotFoundException("File by id $sourceId not found")]);
$this->cache = new FailedCache();
$this->rootPath = '';
throw new NotFoundException("File by id $sourceId not found");
} else {
$this->nonMaskedStorage = $ownerNode->getStorage();
$this->sourcePath = $ownerNode->getPath();
Expand All @@ -164,6 +162,8 @@ private function init() {
$this->storage = new FailedStorage(['exception' => $e]);
$this->cache = new FailedCache();
$this->rootPath = '';
$this->logger->error("Share source no longer available, removing share", ['exception' => $e, 'app' => 'files_sharing']);
$this->unshareStorage();
} catch (NoUserException $e) {
// sharer user deleted, set FailedStorage
$this->storage = new FailedStorage(['exception' => $e]);
Expand Down

0 comments on commit e80c64d

Please sign in to comment.