Skip to content

Commit

Permalink
[6.x] Fix #35795 (#35797)
Browse files Browse the repository at this point in the history
Add an extra is_null check for php 8
  • Loading branch information
Joorren authored Jan 6, 2021
1 parent 006180a commit 08b1b19
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/Concerns/ValidatesAttributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ public function validateJson($attribute, $value)
return false;
}

if (! is_scalar($value) && ! method_exists($value, '__toString')) {
if (! is_scalar($value) && ! is_null($value) && ! method_exists($value, '__toString')) {
return false;
}

Expand Down

0 comments on commit 08b1b19

Please sign in to comment.