We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 5bf0443 + f5a20c5 commit c342963Copy full SHA for c342963
1 file changed
Buffer.php
@@ -77,13 +77,19 @@ public function close()
77
78
public function handleWrite()
79
{
80
+ if (!is_resource($this->stream) || feof($this->stream)) {
81
+ $this->emit('error', array(new \RuntimeException('Tried to write to closed or invalid stream.')));
82
+
83
+ return;
84
+ }
85
86
set_error_handler(array($this, 'errorHandler'));
87
88
$sent = fwrite($this->stream, $this->data);
89
90
restore_error_handler();
91
- if (false === $sent || feof($this->stream)) {
92
+ if (false === $sent) {
93
$this->emit('error', array(new \ErrorException(
94
$this->lastError['message'],
95
0,
0 commit comments