Skip to content

Commit 0353288

Browse files
author
Myztiq
committed
Added check to handle when there is no data.
1 parent 9bc4d3c commit 0353288

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/modem.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,9 @@ Modem.prototype.demuxStream = function(stream, stdout, stderr) {
264264
var nextDataLength = null;
265265
var buffer = new Buffer('');
266266
function processData(data) {
267-
buffer = Buffer.concat([buffer, data]);
267+
if (data) {
268+
buffer = Buffer.concat([buffer, data]);
269+
}
268270
if (!nextDataType) {
269271
if (buffer.length >= 8) {
270272
var header = bufferSlice(8);

0 commit comments

Comments
 (0)