Skip to content

Commit 77b8d68

Browse files
committed
do not apply the Valid constraint on scalar form data
1 parent 998b094 commit 77b8d68

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Extension/Validator/Constraints/FormValidator.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ public function validate($form, Constraint $formConstraint)
110110
foreach ($constraints as $constraint) {
111111
// For the "Valid" constraint, validate the data in all groups
112112
if ($constraint instanceof Valid) {
113-
$validator->atPath('data')->validate($data, $constraint, $groups);
113+
if (\is_object($data)) {
114+
$validator->atPath('data')->validate($data, $constraint, $groups);
115+
}
114116

115117
continue;
116118
}

0 commit comments

Comments
 (0)