mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 10:22:23 +00:00
fix potential panic
This commit is contained in:
parent
c736b04d9b
commit
7340846434
1 changed files with 1 additions and 1 deletions
|
|
@ -54,7 +54,7 @@ func NewHexOrDecimal256(x int64) *HexOrDecimal256 {
|
||||||
// It is similar to UnmarshalText, but allows parsing real decimals too, not just
|
// It is similar to UnmarshalText, but allows parsing real decimals too, not just
|
||||||
// quoted decimal strings.
|
// quoted decimal strings.
|
||||||
func (i *HexOrDecimal256) UnmarshalJSON(input []byte) error {
|
func (i *HexOrDecimal256) UnmarshalJSON(input []byte) error {
|
||||||
if len(input) > 0 && input[0] == '"' {
|
if len(input) > 2 && input[0] == '"' {
|
||||||
input = input[1 : len(input)-1]
|
input = input[1 : len(input)-1]
|
||||||
}
|
}
|
||||||
return i.UnmarshalText(input)
|
return i.UnmarshalText(input)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue