rlp: don't panic for nil *big.Int
All other pointer types can handle nil just fine.
This commit is contained in:
@@ -386,7 +386,12 @@ func writeUint(val reflect.Value, w *encbuf) error {
|
||||
}
|
||||
|
||||
func writeBigIntPtr(val reflect.Value, w *encbuf) error {
|
||||
return writeBigInt(val.Interface().(*big.Int), w)
|
||||
ptr := val.Interface().(*big.Int)
|
||||
if ptr == nil {
|
||||
w.str = append(w.str, 0x80)
|
||||
return nil
|
||||
}
|
||||
return writeBigInt(ptr, w)
|
||||
}
|
||||
|
||||
func writeBigIntNoPtr(val reflect.Value, w *encbuf) error {
|
||||
|
Reference in New Issue
Block a user