8000 [Form] Fix constraints could be null if not set · symfony/symfony@b44e67d · GitHub
[go: up one dir, main page]

Skip to content

Commit b44e67d

Browse files
committed
[Form] Fix constraints could be null if not set
If the form options has no key for constraints the default should be an empty array to be ignored by the loop.
1 parent e5dda01 commit b44e67d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function validate($form, Constraint $constraint)
4545

4646
// Validate the data against the constraints defined
4747
// in the form
48-
$constraints = $config->getOption('constraints');
48+
$constraints = $config->getOption('constraints', array());
4949
foreach ($constraints as $constraint) {
5050
foreach ($groups as $group) {
5151
if (in_array($group, $constraint->groups)) {

0 commit comments

Comments
 (0)
0