Skip to content

Commit

Permalink
Merge pull request #9 from florianleroux/fix/node6.4
Browse files Browse the repository at this point in the history
fix buffer write bug with node 6.4
  • Loading branch information
sidorares authored Aug 22, 2016
2 parents a62b5d7 + fc6cc71 commit 9aa8be9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/ipc.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ function encodeCommand(code, payload) {
I3_MAGIC.copy(buf);
buf.writeUInt32LE(payload.length, 6);
buf.writeUInt32LE(code, 10);
buf.write(payload, payloadOffset);
if (payload.length > 0) {
buf.write(payload, payloadOffset);
}
return buf;
}

Expand Down

0 comments on commit 9aa8be9

Please sign in to comment.