aboutsummaryrefslogtreecommitdiffstats
path: root/ethutil
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2014-04-10 00:27:25 +0800
committerobscuren <geffobscura@gmail.com>2014-04-10 00:27:25 +0800
commit4f2e9c2640eaa962d085db329221bfd6f1a1799e (patch)
tree5cb7e68d376c8c55d9ea878af8787c8e8d66a007 /ethutil
parentc0a030ef0a3ce8342fda2a53cdafd50a271b4837 (diff)
downloaddexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.gz
dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.tar.zst
dexon-4f2e9c2640eaa962d085db329221bfd6f1a1799e.zip
Check for nil
Diffstat (limited to 'ethutil')
-rw-r--r--ethutil/rlp.go7
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)