]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixes occ user:info when the user never logged in 30890/head
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 27 Jan 2022 15:33:24 +0000 (16:33 +0100)
committerLouis (Rebase PR Action) <artonge@users.noreply.github.com>
Mon, 31 Jan 2022 10:26:20 +0000 (10:26 +0000)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
core/Command/User/Info.php

index abc8938ed5496b7397edca7f68dd0cd6a9146316..36bfa0b6d5b1f7562f80a24fe88a58580ecee149 100644 (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'],