diff --git a/lib/files/view.php b/lib/files/view.php
index 468808566a776927faaf85cb73c85721761a89c0..994dbcc85cfd4f111b965ef971dec6f74a80a27a 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -691,20 +691,22 @@ class View {
 
 			$data = $cache->get($internalPath);
 
-			if ($data['mimetype'] === 'httpd/unix-directory') {
-				//add the sizes of other mountpoints to the folder
-				$mountPoints = Filesystem::getMountPoints($path);
-				foreach ($mountPoints as $mountPoint) {
-					$subStorage = Filesystem::getStorage($mountPoint);
-					$subCache = $subStorage->getCache();
-					$rootEntry = $subCache->get('');
-
-					$data['size'] += $rootEntry['size'];
+			if ($data) {
+				if ($data['mimetype'] === 'httpd/unix-directory') {
+					//add the sizes of other mountpoints to the folder
+					$mountPoints = Filesystem::getMountPoints($path);
+					foreach ($mountPoints as $mountPoint) {
+						$subStorage = Filesystem::getStorage($mountPoint);
+						$subCache = $subStorage->getCache();
+						$rootEntry = $subCache->get('');
+
+						$data['size'] += $rootEntry['size'];
+					}
 				}
-			}
 
-			$permissionsCache = $storage->getPermissionsCache();
-			$data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser());
+				$permissionsCache = $storage->getPermissionsCache();
+				$data['permissions'] = $permissionsCache->get($data['fileid'], \OC_User::getUser());
+			}
 		}
 		return $data;
 	}
@@ -888,7 +890,7 @@ class View {
 	 * @param string $path
 	 * @return string
 	 */
-	public function getETag($path){
+	public function getETag($path) {
 		/**
 		 * @var Storage\Storage $storage
 		 * @var string $internalPath
diff --git a/tests/lib/files/cache/cache.php b/tests/lib/files/cache/cache.php
index e9105cd5abd6f8d6371a08e440383e6cdec42be6..a2b131ac0aca9b37cda7aebc97dfc4ac6e0b3906 100644
--- a/tests/lib/files/cache/cache.php
+++ b/tests/lib/files/cache/cache.php
@@ -192,6 +192,11 @@ class Cache extends \UnitTestCase {
 		$this->assertEquals($file3, $this->cache->getIncomplete());
 	}
 
+	function testNonExisting() {
+		$this->assertFalse($this->cache->get('foo.txt'));
+		$this->assertEquals(array(), $this->cache->getFolderContents('foo'));
+	}
+
 	public function tearDown() {
 		$this->cache->clear();
 	}
diff --git a/tests/lib/files/view.php b/tests/lib/files/view.php
index ed08dcc114862d2e385e5bd3ec4b19417e86dbde..1b8f6dc1e8cc3e383e431e4eec3cfa828d2a3b9e 100644
--- a/tests/lib/files/view.php
+++ b/tests/lib/files/view.php
@@ -92,6 +92,9 @@ class View extends \PHPUnit_Framework_TestCase {
 		$cachedData = $rootView->getFileInfo('/foo.txt');
 		$this->assertTrue($cachedData['encrypted']);
 		$this->assertEquals($cachedData['fileid'], $id);
+
+		$this->assertFalse($rootView->getFileInfo('/non/existing'));
+		$this->assertEquals(array(), $rootView->getDirectoryContent('/non/existing'));
 	}
 
 	public function testAutoScan() {