Skip to content

Commit

Permalink
do not apply the Valid constraint on scalar form data
Browse files Browse the repository at this point in the history
  • Loading branch information
xabbuh committed Dec 5, 2020
1 parent 053d8fb commit 14adc60
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public function validate($form, Constraint $formConstraint)
foreach ($constraints as $constraint) {
// For the "Valid" constraint, validate the data in all groups
if ($constraint instanceof Valid) {
$validator->atPath('data')->validate($data, $constraint, $groups);
if (\is_object($data)) {
$validator->atPath('data')->validate($data, $constraint, $groups);
}

continue;
}
Expand Down

0 comments on commit 14adc60

Please sign in to comment.