From c54792eee8ac4e2340831a4bf989753a4703291d Mon Sep 17 00:00:00 2001 From: Hongliang Xu Date: Tue, 7 Mar 2017 12:01:07 -0800 Subject: [PATCH] addressing mingmin's comments --- lib/producer_record.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/producer_record.js b/lib/producer_record.js index 214e647..df2a14a 100644 --- a/lib/producer_record.js +++ b/lib/producer_record.js @@ -36,7 +36,7 @@ ProducerRecord.prototype.validate = function validate() { if (typeof self.value !== 'string' && !Buffer.isBuffer(self.value)) { return new Error('ProducerRecord value is neither string nor byte array'); } - if (self.key !== undefined && typeof self.value !== 'string') { + if (self.key !== undefined && typeof self.key !== 'string' && !Buffer.isBuffer(self.key)) { return new Error('ProducerRecord value is neither string'); } return null;