8000 Edited src/Symfony/Component/Console/Helper/DialogHelper.php via GitHub · symfony/symfony@511a9a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 511a9a1

Browse files
committed
Edited src/Symfony/Component/Console/Helper/DialogHelper.php via GitHub
1 parent 292d97d commit 511a9a1

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Symfony/Component/Console/Helper/DialogHelper.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,12 @@ public function ask(OutputInterface $output, $question, $default = null)
3535
{
3636
$output->write 8E13 ($question);
3737

38-
$ret = trim(fgets(null === $this->inputStream ? STDIN : $this->inputStream));
38+
if (false === $ret = fgets(null === $this->inputStream ? STDIN : $this->inputStream)) {
39+
throw new \Exception('Aborted');
40+
}
41+
$ret = trim($ret);
3942

40-
return $ret ? $ret : $default;
43+
return strlen($ret) > 0 ? $ret : $default;
4144
}
4245

4346
/**

0 commit comments

Comments
 (0)
0