diff --git a/src/Symfony/Component/Console/Output/StreamOutput.php b/src/Symfony/Component/Console/Output/StreamOutput.php index 7ff602763e9da..e1b8c9ca5437a 100644 --- a/src/Symfony/Component/Console/Output/StreamOutput.php +++ b/src/Symfony/Component/Console/Output/StreamOutput.php @@ -74,10 +74,10 @@ protected function doWrite($message, $newline) $message .= PHP_EOL; } - if (false === @fwrite($this->stream, $message)) { - // should never happen + if (!is_resource($this->stream) || !is_string($message)) { throw new RuntimeException('Unable to write output.'); } + @fwrite($this->stream, $message); fflush($this->stream); }