Merge pull request #21018 from nextcloud/bug/20498/add-defaults-on-empty

Create account structure also for empty record
pull/20914/head
Roeland Jago Douma 5 years ago committed by GitHub
commit 1c1b349473
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      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);
}

Loading…
Cancel
Save