From c6f770ea59e0a0f38f1baa5b52b87b20a83b50fd Mon Sep 17 00:00:00 2001
From: Daniel Kesselberg <mail@danielkesselberg.de>
Date: Sun, 17 May 2020 15:30:36 +0200
Subject: [PATCH] Create account structure also for empty record

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
---
 lib/private/Accounts/AccountManager.php | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/private/Accounts/AccountManager.php b/lib/private/Accounts/AccountManager.php
index 8b0cb972c59..7b99fb0a410 100644
--- a/lib/private/Accounts/AccountManager.php
+++ b/lib/private/Accounts/AccountManager.php
@@ -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);
 		}
-- 
GitLab