Skip to content

Commit 8ae5f4d

Browse files
committed
hexToBuffer accept empty string
So it's possible to: ``` bitcore.util.buffer.hexToBuffer('').toString('hex'); ``` that produce an empty string as expected, instead od an assertion error. This commit makes bitpay#3181 unnecessary.
1 parent a90b8f5 commit 8ae5f4d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/bitcore-lib-ltc/lib/util/buffer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ module.exports = {
163163
* @return {Buffer}
164164
*/
165165
hexToBuffer: function hexToBuffer(string) {
166-
assert(js.isHexa(string));
166+
assert(js.isHexa(string) || ('' === string));
167167
return Buffer.from(string, 'hex');
168168
}
169169
};

0 commit comments

Comments
 (0)