Make sure root storage is valid before checking its size

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
This commit is contained in:
John Molakvoæ (skjnldsv) 2020-11-08 00:10:06 +01:00
parent a5fa9604ba
commit 6a453ac184
No known key found for this signature in database
GPG Key ID: 60C25B8C072916CF
1 changed files with 4 additions and 1 deletions

View File

@ -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();