Plug a hole in the linux/unix read function (#945)

`this.buffer` is never initialized so if we close the port while reading we'll get an error. This has no tests but doesn't fail any of our current tests. With the streams rewrite this is no longer an issue and instead of testing it fully here I'd rather concentrate on a new implementation of it.
This commit is contained in:
Francis Gulotta 2016-09-28 14:15:06 -04:00 • committed by GitHub
parent b78c888408
commit 0597034194

View file

@ -345,6 +345,9 @@ if (process.platform !== 'win32') {
// do not emit events if the stream is paused
if (this.paused) {
if (!this.buffer) {
this.buffer = new Buffer(0);
}
this.buffer = Buffer.concat([this.buffer, b]);
return;
}