diff options
-rw-r--r-- | it_pipe.class | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/it_pipe.class b/it_pipe.class index 54f4a5b..cd1b54f 100644 --- a/it_pipe.class +++ b/it_pipe.class @@ -239,7 +239,8 @@ function pipe($cmd, ...$args) fwrite($pipes[0], join("\n", $this->lines) . ($this->lines ? "\n" :"")); fclose($pipes[0]); - $this->lines = explode("\n", rtrim(stream_get_contents($pipes[1]))); + $out = stream_get_contents($pipes[1]); + $this->lines = $out === "" ? [] : explode("\n", rtrim($out, "\n")); fclose($pipes[1]); proc_close($process); |