namespace OCA\Files_Sharing;
+use OC\Files\Cache\FailedCache;
use OC\Files\Cache\Wrapper\CacheJail;
use OCP\Files\Cache\ICacheEntry;
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;
}