Commit 4f2e9c26 authored by obscuren's avatar obscuren

Check for nil

parent c0a030ef
...@@ -186,7 +186,12 @@ func Encode(object interface{}) []byte { ...@@ -186,7 +186,12 @@ func Encode(object interface{}) []byte {
case byte: case byte:
buff.Write(Encode(big.NewInt(int64(t)))) buff.Write(Encode(big.NewInt(int64(t))))
case *big.Int: case *big.Int:
// Not sure how this is possible while we check for
if t == nil {
buff.WriteByte(0xc0)
} else {
buff.Write(Encode(t.Bytes())) buff.Write(Encode(t.Bytes()))
}
case []byte: case []byte:
if len(t) == 1 && t[0] <= 0x7f { if len(t) == 1 && t[0] <= 0x7f {
buff.Write(t) buff.Write(t)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment