From 6a453ac184f42cae7fca5dc5e6913e32594b709b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?=
 <skjnldsv@protonmail.com>
Date: Sun, 8 Nov 2020 00:10:06 +0100
Subject: [PATCH] Make sure root storage is valid before checking its size
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
---
 lib/private/Files/Storage/Wrapper/Quota.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/private/Files/Storage/Wrapper/Quota.php b/lib/private/Files/Storage/Wrapper/Quota.php
index 4b99af46b02..406f0fd4649 100644
--- a/lib/private/Files/Storage/Wrapper/Quota.php
+++ b/lib/private/Files/Storage/Wrapper/Quota.php
@@ -71,7 +71,10 @@ class Quota extends Wrapper {
 	protected function getSize($path, $storage = null) {
 		if ($this->config->getValue('quota_include_external_storage', false)) {
 			$rootInfo = Filesystem::getFileInfo('', 'ext');
-			return $rootInfo->getSize(true);
+			if ($rootInfo) {
+				return $rootInfo->getSize(true);
+			}
+			return \OCP\Files\FileInfo::SPACE_NOT_COMPUTED;
 		} else {
 			if (is_null($storage)) {
 				$cache = $this->getCache();
-- 
GitLab