Skip to content
This repository has been archived by the owner on Aug 5, 2023. It is now read-only.

Commit

Permalink
修复数组optional无法接收null的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kamicloud committed Aug 7, 2019
1 parent c17cfdc commit 7b13b57
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/php/lib/Concerns/ValueHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ protected function validateValue($value, $field, $rule, $type, $location, $input

if ($isArray) {
if (!is_array($value)) {
if ($isOptional && $value === null) {
return null;
}
throw new $exception("{$location} should be array");
}

Expand Down

0 comments on commit 7b13b57

Please sign in to comment.