Skip to content

Commit 8efcf72

Browse files
committed
pass the empty string instead of null as key to array_key_exists()
1 parent 4d0d05a commit 8efcf72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public function getChoicesForValues(array $values): array
114114
$choices = [];
115115

116116
foreach ($values as $i => $givenValue) {
117-
if (\array_key_exists($givenValue, $this->choices)) {
117+
if (\array_key_exists($givenValue ?? '', $this->choices)) {
118118
$choices[$i] = $this->choices[$givenValue];
119119
}
120120
}

0 commit comments

Comments
 (0)