diff options
author | Felix Lange <fjl@users.noreply.github.com> | 2017-01-13 16:45:40 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-13 16:45:40 +0800 |
commit | 01f6f2d741e717f669b7ba1d6b88991f28e30c72 (patch) | |
tree | f87ea1219834c44cd2e8ab6a64da9c49edef37cb /common/hexutil/json.go | |
parent | c5df37c1119107ddcc517127b3bd7c2ab4e3649f (diff) | |
download | dexon-01f6f2d741e717f669b7ba1d6b88991f28e30c72.tar.gz dexon-01f6f2d741e717f669b7ba1d6b88991f28e30c72.tar.zst dexon-01f6f2d741e717f669b7ba1d6b88991f28e30c72.zip |
common/hexutil: allow empty strings when decoding JSON (#3559)
Diffstat (limited to 'common/hexutil/json.go')
-rw-r--r-- | common/hexutil/json.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/common/hexutil/json.go b/common/hexutil/json.go index cbbadbed6..c36d862b5 100644 --- a/common/hexutil/json.go +++ b/common/hexutil/json.go @@ -237,7 +237,7 @@ func checkJSON(input []byte) (raw []byte, err error) { return nil, errNonString } if len(input) == 2 { - return nil, ErrEmptyString + return nil, nil // empty strings are allowed } if !bytesHave0xPrefix(input[1:]) { return nil, ErrMissingPrefix @@ -255,7 +255,7 @@ func checkNumberJSON(input []byte) (raw []byte, err error) { } input = input[1 : len(input)-1] if len(input) == 0 { - return nil, ErrEmptyString + return nil, nil // empty strings are allowed } if !bytesHave0xPrefix(input) { return nil, ErrMissingPrefix |