dont die if we try to access the shared cache while setting up the shared storage
Signed-off-by: Robin Appelman <robin@icewind.nl>
This commit is contained in:
parent
e76081e858
commit
cbabc568db
|
@ -27,6 +27,7 @@
|
||||||
|
|
||||||
namespace OCA\Files_Sharing;
|
namespace OCA\Files_Sharing;
|
||||||
|
|
||||||
|
use OC\Files\Cache\FailedCache;
|
||||||
use OC\Files\Cache\Wrapper\CacheJail;
|
use OC\Files\Cache\Wrapper\CacheJail;
|
||||||
use OCP\Files\Cache\ICacheEntry;
|
use OCP\Files\Cache\ICacheEntry;
|
||||||
|
|
||||||
|
@ -68,7 +69,13 @@ class Cache extends CacheJail {
|
||||||
|
|
||||||
public function getCache() {
|
public function getCache() {
|
||||||
if (is_null($this->cache)) {
|
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;
|
return $this->cache;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue