summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2018-10-16 10:57:37 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2018-10-16 10:57:37 +0200
commit1bc388e5074055e67a961eef42ffa4953b9a3c98 (patch)
treef7d1c592ccf92571bc81a9707b3463cfe570efd0 /apps/files_sharing
parentad66b0f9ab010ee00d249d6f8512d30332e8a0af (diff)
downloadnextcloud-server-1bc388e5074055e67a961eef42ffa4953b9a3c98.tar.gz
nextcloud-server-1bc388e5074055e67a961eef42ffa4953b9a3c98.zip
Double check for failed cache with a shared storage
When obtaining the SourceRootInfo we can call init. If this fails the cache is set to a failed cache and the storage to a failed storage. However we did not check for this. Which means that if the storage was invalid it would fail later on. Now we will properly error out. Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/lib/SharedStorage.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/SharedStorage.php b/apps/files_sharing/lib/SharedStorage.php
index 34a21fcd637..f9c4a85fac6 100644
--- a/apps/files_sharing/lib/SharedStorage.php
+++ b/apps/files_sharing/lib/SharedStorage.php
@@ -378,10 +378,12 @@ class SharedStorage extends \OC\Files\Storage\Wrapper\Jail implements ISharedSto
if (!$storage) {
$storage = $this;
}
+ $sourceRoot = $this->getSourceRootInfo();
if ($this->storage instanceof FailedStorage) {
return new FailedCache();
}
- $this->cache = new \OCA\Files_Sharing\Cache($storage, $this->getSourceRootInfo(), $this->superShare);
+
+ $this->cache = new \OCA\Files_Sharing\Cache($storage, $sourceRoot, $this->superShare);
return $this->cache;
}