From 090f1c927d7ed82210414e28c7fc177169627960 Mon Sep 17 00:00:00 2001 From: AJ ONeal Date: Fri, 30 Sep 2016 02:14:02 -0400 Subject: [PATCH] allow null buffer --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index aad0ba6..91e55a1 100644 --- a/index.js +++ b/index.js @@ -229,6 +229,7 @@ module.exports.create = function (opts) { }; module.exports.pack = function (address, data, type) { + data = data || Buffer.alloc(0); if (type || (data.byteLength <= '|__ERROR__|'.length)) { if ('error' === type || '|__ERROR__|' === data.toString()) { address.type = 'error';