Create account structure also for empty record

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
This commit is contained in:
Daniel Kesselberg 2020-05-17 15:30:36 +02:00
parent 703d716a32
commit c6f770ea59
No known key found for this signature in database
GPG Key ID: 36E3664E099D0614
1 changed files with 1 additions and 1 deletions

View 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);
}