Skip to content

Commit c9072c7

Browse files
committed
Check value isset to avoid PHP notice
1 parent 2ecd793 commit c9072c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Symfony/Component/Console/Style/SymfonyStyle.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ public function choice($question, array $choices, $default = null)
229229
{
230230
if (null !== $default) {
231231
$values = array_flip($choices);
232-
$default = $values[$default];
232+
$default = isset($values[$default]) ? $values[$default] : $default;
233233
}
234234

235235
return $this->askQuestion(new ChoiceQuestion($question, $choices, $default));

0 commit comments

Comments
 (0)