Skip to content

Commit

Permalink
Merge pull request #865 from erikn69/patch-17
Browse files Browse the repository at this point in the history
fix ArrayObject::__construct() TypeError
  • Loading branch information
MortenDHansen authored Oct 6, 2023
2 parents a80dcb9 + b8974eb commit 430e9cc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ protected function getFormattedValue(Model $model, string $key, $value)
$key,
$model->getCasts()
) && $model->getCasts()[$key] == 'Illuminate\Database\Eloquent\Casts\AsArrayObject') {
$arrayObject = new \Illuminate\Database\Eloquent\Casts\ArrayObject(json_decode($value, true));
$arrayObject = new \Illuminate\Database\Eloquent\Casts\ArrayObject(json_decode($value, true) ?: []);
return $arrayObject;
}

Expand Down

0 comments on commit 430e9cc

Please sign in to comment.