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>
This commit is contained in:
parent
642606754b
commit
bbe41a73dd
|
@ -137,6 +137,9 @@ class AccountManager implements IAccountManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
$userDataArray = json_decode($result[0]['data'], true);
|
$userDataArray = json_decode($result[0]['data'], true);
|
||||||
|
if ($userDataArray === null || json_last_error() !== JSON_ERROR_NONE) {
|
||||||
|
return $this->buildDefaultUserRecord($user);
|
||||||
|
}
|
||||||
|
|
||||||
$userDataArray = $this->addMissingDefaultValues($userDataArray);
|
$userDataArray = $this->addMissingDefaultValues($userDataArray);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue