Skip to content

Commit

Permalink
Update index.js
Browse files Browse the repository at this point in the history
  • Loading branch information
SilentCicero committed Aug 8, 2017
1 parent 91eba4a commit d3f7afb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ function formatData(value, byteLength) {
}

// throw if bytelength is not correct
if (typeof byteLength === 'number' && value !== null && output !== '0x' // support empty values
if (typeof byteLength === 'number' && value !== null && output !== '0x' && output !== '0x00' // support empty values
&& (!/^[0-9A-Fa-f]+$/.test(stripHexPrefix(output)) || outputByteLength !== 2 + byteLength * 2)) {
throw new Error(`[ethjs-format] hex string '${output}' must be an alphanumeric ${2 + byteLength * 2} utf8 byte hex (chars: a-fA-F) string, is ${outputByteLength} bytes`);
}
Expand Down

0 comments on commit d3f7afb

Please sign in to comment.