diff --git a/lib/serialport.js b/lib/serialport.js index b017148..df92a89 100644 --- a/lib/serialport.js +++ b/lib/serialport.js @@ -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; }