mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-25 13:07:17 +00:00
Check for nil
This commit is contained in:
parent
c0a030ef0a
commit
4f2e9c2640
@ -186,7 +186,12 @@ func Encode(object interface{}) []byte {
|
||||
case byte:
|
||||
buff.Write(Encode(big.NewInt(int64(t))))
|
||||
case *big.Int:
|
||||
buff.Write(Encode(t.Bytes()))
|
||||
// Not sure how this is possible while we check for
|
||||
if t == nil {
|
||||
buff.WriteByte(0xc0)
|
||||
} else {
|
||||
buff.Write(Encode(t.Bytes()))
|
||||
}
|
||||
case []byte:
|
||||
if len(t) == 1 && t[0] <= 0x7f {
|
||||
buff.Write(t)
|
||||
|
Loading…
Reference in New Issue
Block a user