diff options
author | obscuren <geffobscura@gmail.com> | 2014-04-10 00:27:25 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-04-10 00:27:25 +0800 |
commit | 4f2e9c2640eaa962d085db329221bfd6f1a1799e (patch) | |
tree | 5cb7e68d376c8c55d9ea878af8787c8e8d66a007 | |
parent | c0a030ef0a3ce8342fda2a53cdafd50a271b4837 (diff) | |
download | dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.gz dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.bz2 dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.lz dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.xz dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.zst dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.zip |
Check for nil
-rw-r--r-- | ethutil/rlp.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ethutil/rlp.go b/ethutil/rlp.go index e6c75696e..d95ace425 100644 --- a/ethutil/rlp.go +++ b/ethutil/rlp.go @@ -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) |