diff options
author | Robin Appelman <robin@icewind.nl> | 2017-06-19 13:47:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-19 13:47:59 +0200 |
commit | c9ef998f173cb9dbbf399df5c336c9113b095c4c (patch) | |
tree | 034e4321cc9d8724ebbca0ab3de2696a05aa57f8 /apps/files_sharing | |
parent | a5ad6def3d0a7509da2d143b789f670c611d848f (diff) | |
parent | ed8903404768f5957ddf39f5979741b18000f69d (diff) | |
download | nextcloud-server-c9ef998f173cb9dbbf399df5c336c9113b095c4c.tar.gz nextcloud-server-c9ef998f173cb9dbbf399df5c336c9113b095c4c.zip |
Merge pull request #5091 from nextcloud/shared-cache-during-init
dont die if we try to access the shared cache while setting up the shared storage
Diffstat (limited to 'apps/files_sharing')
-rw-r--r-- | apps/files_sharing/lib/Cache.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/Cache.php b/apps/files_sharing/lib/Cache.php index d9cf5d80b80..1c311935bb6 100644 --- a/apps/files_sharing/lib/Cache.php +++ b/apps/files_sharing/lib/Cache.php @@ -27,6 +27,7 @@ namespace OCA\Files_Sharing; +use OC\Files\Cache\FailedCache; use OC\Files\Cache\Wrapper\CacheJail; use OCP\Files\Cache\ICacheEntry; @@ -68,7 +69,13 @@ class Cache extends CacheJail { public function getCache() { if (is_null($this->cache)) { - $this->cache = $this->storage->getSourceStorage()->getCache(); + $sourceStorage = $this->storage->getSourceStorage(); + if ($sourceStorage) { + $this->cache = $sourceStorage->getCache(); + } else { + // don't set $this->cache here since sourceStorage will be set later + return new FailedCache(); + } } return $this->cache; } |