Merge pull request #30890 from nextcloud/backport/30886/stable23

[stable23] Fixes occ user:info when the user never logged in
This commit is contained in:
Louis 2022-01-31 13:44:37 +01:00 committed by GitHub
commit abf2ed8ce7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -97,7 +97,11 @@ class Info extends Base {
protected function getStorageInfo(IUser $user): array {
\OC_Util::tearDownFS();
\OC_Util::setupFS($user->getUID());
$storage = \OC_Helper::getStorageInfo('/');
try {
$storage = \OC_Helper::getStorageInfo('/');
} catch (\OCP\Files\NotFoundException $e) {
return [];
}
return [
'free' => $storage['free'],
'used' => $storage['used'],