diff options
author | Robin Appelman <robin@icewind.nl> | 2017-05-24 14:56:09 +0300 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2017-06-19 15:01:39 +0300 |
commit | 3758eb80477e34f00023b70082c16a2c66df7c44 (patch) | |
tree | b5e23b35c362620628bf0333c6fc9357126f643b | |
parent | d22d3b316f547173a39d18564cc8a5fd3555d0df (diff) |
dont die if we try to access the shared cache while setting up the shared storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
-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 bc10ddbd94f..a55c2a0848d 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; use OCP\Files\Storage\IStorage; @@ -66,7 +67,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; } |