From 58b810a5477fc18c2b99a714da7f84199cc02ee6 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 22 Aug 2016 12:32:39 +0200 Subject: [PATCH] handle failed shares --- apps/files_sharing/lib/sharedstorage.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php index 7a7bb58982..b67c9c5efb 100644 --- a/apps/files_sharing/lib/sharedstorage.php +++ b/apps/files_sharing/lib/sharedstorage.php @@ -95,6 +95,8 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage { list($this->storage, $this->rootPath) = $this->ownerView->resolvePath($sourcePath); $this->sourceRootInfo = $this->storage->getCache()->get($this->rootPath); } catch (\Exception $e) { + $this->storage = new FailedStorage(['exception' => $e]); + $this->rootPath = ''; $this->logger->logException($e); } } @@ -293,7 +295,7 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage { public function getCache($path = '', $storage = null) { $this->init(); - if (is_null($this->storage)) { + if (is_null($this->storage) || $this->storage instanceof FailedStorage) { return new FailedCache(false); } if (!$storage) {