]> source.dussan.org Git - nextcloud-server.git/commitdiff
Create account structure also for empty record 21018/head
authorDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 17 May 2020 13:30:36 +0000 (15:30 +0200)
committerDaniel Kesselberg <mail@danielkesselberg.de>
Sun, 17 May 2020 13:30:36 +0000 (15:30 +0200)
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
lib/private/Accounts/AccountManager.php

index 8b0cb972c5989f7427e6b12d56a7ac92ea2c156a..7b99fb0a4103ef592dac7d5799f64487acffa009 100644 (file)
@@ -148,7 +148,7 @@ class AccountManager implements IAccountManager {
 
                $userDataArray = json_decode($result[0]['data'], true);
                $jsonError = json_last_error();
-               if ($userDataArray === null || $jsonError !== JSON_ERROR_NONE) {
+               if ($userDataArray === null || $userDataArray === [] || $jsonError !== JSON_ERROR_NONE) {
                        $this->logger->critical("User data of $uid contained invalid JSON (error $jsonError), hence falling back to a default user record");
                        return $this->buildDefaultUserRecord($user);
                }