mirror of
https://git.coolaj86.com/coolaj86/proxy-packer.js.git
synced 2025-03-13 03:50:48 +00:00
allow null buffer
This commit is contained in:
parent
389e65bb7f
commit
090f1c927d
1
index.js
1
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';
|
||||
|
Loading…
x
Reference in New Issue
Block a user