From 0c4297cee9ee3b8cf8d5511f2a28922607d0f508 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= 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) --- 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 4b99af46b0..406f0fd464 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();