aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/SharedStorage.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/SharedStorage.php')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 6b605a6eddb..f59f128781c 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -146,9 +146,7 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
/** @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();
@@ -163,6 +161,8 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
$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]);