Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
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 <[email protected]>
  • Loading branch information
kesselb authored and ChristophWurst committed Dec 13, 2019
commit bbe41a73dd0a77c572c78e9df8a77ff7b0cb7bf2
3 changes: 3 additions & 0 deletions lib/private/Accounts/AccountManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ public function getUser(IUser $user) {
}

$userDataArray = json_decode($result[0]['data'], true);
if ($userDataArray === null || json_last_error() !== JSON_ERROR_NONE) {
return $this->buildDefaultUserRecord($user);
}

$userDataArray = $this->addMissingDefaultValues($userDataArray);

Expand Down