Skip to content

Commit

Permalink
fix: not all message payloads are arrays of Buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbroadst committed Dec 30, 2019
1 parent 4b2b81f commit e4df5f4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/cmap/message_stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ class MessageStream extends Duplex {
// TODO: agreed compressor should live in `StreamDescription`
const shouldCompress = operationDescription && !!operationDescription.agreedCompressor;
if (!shouldCompress || !canCompress(command)) {
this.push(Buffer.concat(command.toBin()));
const data = command.toBin();
this.push(Array.isArray(data) ? Buffer.concat(data) : data);
return;
}

Expand Down

0 comments on commit e4df5f4

Please sign in to comment.