Browse Source

Return a default user record if json is broken

It's possible that json_decode returns null. Mostly the json is broken.
AddMissingDefaultValues expects an array. Pass null will fail.

Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
pull/17494/head
Daniel Kesselberg 6 years ago
committed by Christoph Wurst
parent
commit
bbe41a73dd
No known key found for this signature in database GPG Key ID: CC42AC2A7F0E56D8
  1. 3
      lib/private/Accounts/AccountManager.php

3
lib/private/Accounts/AccountManager.php

@ -137,6 +137,9 @@ class AccountManager implements IAccountManager {
}
$userDataArray = json_decode($result[0]['data'], true);
if ($userDataArray === null || json_last_error() !== JSON_ERROR_NONE) {
return $this->buildDefaultUserRecord($user);
}
$userDataArray = $this->addMissingDefaultValues($userDataArray);

Loading…
Cancel
Save