summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_sharing/lib/sharedstorage.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 45d36ab4bf3..a25b328fcf0 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -37,6 +37,7 @@ use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
+use OC\Files\Storage\FailedStorage;
/**
* Convert target path to source path and pass the function call to the correct storage provider
@@ -99,12 +100,13 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
list($this->sourceStorage, $sourceInternalPath) = $this->ownerView->resolvePath($sourcePath);
$this->sourceRootInfo = $this->sourceStorage->getCache()->get($sourceInternalPath);
// adjust jail
- $this->storage = $this->sourceStorage;
$this->rootPath = $sourceInternalPath;
} catch (\Exception $e) {
+ $this->sourceStorage = new FailedStorage(['exception' => $e]);
$this->logger->logException($e);
}
+ $this->storage = $this->sourceStorage;
}
/**
@@ -311,7 +313,7 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
public function getCache($path = '', $storage = null) {
$this->init();
- if (is_null($this->sourceStorage)) {
+ if (is_null($this->sourceStorage) || $this->sourceStorage instanceof FailedStorage) {
return new FailedCache(false);
}
if (!$storage) {
@@ -439,5 +441,4 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
return $this->sourceStorage;
}
-
}