Skip to content

Commit 2efb89d

Browse files
committed
Guard for nil *big.Int
1 parent 585aec1 commit 2efb89d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

rpc/types.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ func newHexData(input interface{}) *hexdata {
8383
d.data = input.Bytes()
8484
}
8585
case *big.Int:
86-
d.data = input.Bytes()
86+
if input == nil {
87+
d.isNil = true
88+
} else {
89+
d.data = input.Bytes()
90+
}
8791
case int64:
8892
d.data = big.NewInt(input).Bytes()
8993
case uint64:

0 commit comments

Comments
 (0)