From e4df5f4f102231dea2054fae3b9fe7bbbf256c20 Mon Sep 17 00:00:00 2001 From: Matt Broadstone Date: Wed, 18 Dec 2019 18:13:14 -0500 Subject: [PATCH] fix: not all message payloads are arrays of Buffer --- lib/cmap/message_stream.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cmap/message_stream.js b/lib/cmap/message_stream.js index 8bab9250f7..15a4c75a6a 100644 --- a/lib/cmap/message_stream.js +++ b/lib/cmap/message_stream.js @@ -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; }