Skip to content

Commit

Permalink
Fix setSettingsAttribute for null values (#4981)
Browse files Browse the repository at this point in the history
* Fix setSettingsAttribute for null values

* Fix json encode for setSettingsAttribute

Co-authored-by: Christoph Schweppe <info@cschweppe.de>
  • Loading branch information
magarrent and emptynick committed Jul 6, 2020
1 parent 56bef5c commit 865209f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function setCreatedAtAttribute($value)

public function setSettingsAttribute($value)
{
$this->attributes['settings'] = $value->toJson();
$this->attributes['settings'] = $value ? $value->toJson() : json_encode([]);
}

public function getSettingsAttribute($value)
Expand Down

0 comments on commit 865209f

Please sign in to comment.