diff --git a/lib/ProcessInputStream.php b/lib/ProcessInputStream.php index cb6f8b2..e3d5b13 100644 --- a/lib/ProcessInputStream.php +++ b/lib/ProcessInputStream.php @@ -32,7 +32,9 @@ class ProcessInputStream implements InputStream { if ($error) { $this->error = new StreamException("Failed to launch process", 0, $error); if ($this->initialRead) { - $this->initialRead->fail($this->error); + $initialRead = $this->initialRead; + $this->initialRead = null; + $initialRead->fail($this->error); } return; }