diff --git a/lib/files/view.php b/lib/files/view.php
index 6d917bb585e45ff846a510dd536a525e6544c880..592c484a21c8a7714bf1360620671ab025b2356c 100644
--- a/lib/files/view.php
+++ b/lib/files/view.php
@@ -697,10 +697,11 @@ class View {
 					$mountPoints = Filesystem::getMountPoints($path);
 					foreach ($mountPoints as $mountPoint) {
 						$subStorage = Filesystem::getStorage($mountPoint);
-						$subCache = $subStorage->getCache();
-						$rootEntry = $subCache->get('');
-
-						$data['size'] += $rootEntry['size'];
+						if ($subStorage) {
+							$subCache = $subStorage->getCache();
+							$rootEntry = $subCache->get('');
+							$data['size'] += $rootEntry['size'];
+						}
 					}
 				}