Fixes occ user:info when the user never logged in

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2022-01-27 16:33:24 +01:00
parent 34f425c150
commit 071ceff7e2
No known key found for this signature in database
GPG key ID: A3E2F658B28C760A

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'],