Skip to content

Commit

Permalink
Merge pull request #1034 from spiral/bugfix/file_descriptor
Browse files Browse the repository at this point in the history
[spiral/console] Check that the stream is not null before calling the posix_isatty function
  • Loading branch information
butschster authored Dec 19, 2023
2 parents 6a38b50 + 8c0e2fa commit aa1cc27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Console/src/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ private function configureIO(InputInterface $input, OutputInterface $output): vo
$inputStream = $input->getStream();
}

if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
if ($inputStream !== null && !@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
$input->setInteractive(false);
}
}
Expand Down

0 comments on commit aa1cc27

Please sign in to comment.