From 2049bedcaf670ef2394ce8b19e0d3f2174513b53 Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Tue, 15 Apr 2014 16:36:05 +0200
Subject: [PATCH] Dont throw an error when a storage isn't found for shared
 cache

---
 apps/files_sharing/lib/cache.php | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/apps/files_sharing/lib/cache.php b/apps/files_sharing/lib/cache.php
index 4b473c6057..4a2f0ff08b 100644
--- a/apps/files_sharing/lib/cache.php
+++ b/apps/files_sharing/lib/cache.php
@@ -53,9 +53,9 @@ class Shared_Cache extends Cache {
 		$source = \OC_Share_Backend_File::getSource($target, $this->storage->getMountPoint(), $this->storage->getItemType());
 		if (isset($source['path']) && isset($source['fileOwner'])) {
 			\OC\Files\Filesystem::initMountPoints($source['fileOwner']);
-			$mount = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
-			if (is_array($mount)) {
-				$fullPath = $mount[key($mount)]->getMountPoint() . $source['path'];
+			$mounts = \OC\Files\Filesystem::getMountByNumericId($source['storage']);
+			if (is_array($mounts) and count($mounts)) {
+				$fullPath = $mounts[0]->getMountPoint() . $source['path'];
 				list($storage, $internalPath) = \OC\Files\Filesystem::resolvePath($fullPath);
 				if ($storage) {
 					$this->files[$target] = $internalPath;
-- 
GitLab