From 32fc3845f0f86671f4420bac60cc12bbe4472c5f Mon Sep 17 00:00:00 2001
From: Jeromy <jeromyj@gmail.com>
Date: Fri, 13 Feb 2015 07:47:51 +0000
Subject: [PATCH] fix for #757

---
 p2p/peer/peer.go | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/p2p/peer/peer.go b/p2p/peer/peer.go
index 124d6ba6c..9491effbc 100644
--- a/p2p/peer/peer.go
+++ b/p2p/peer/peer.go
@@ -154,9 +154,11 @@ func (pi *PeerInfo) UnmarshalJSON(b []byte) error {
 		return err
 	}
 	pi.ID = pid
-	addrs := data["Addrs"].([]interface{})
-	for _, a := range addrs {
-		pi.Addrs = append(pi.Addrs, ma.StringCast(a.(string)))
+	addrs, ok := data["Addrs"].([]interface{})
+	if ok {
+		for _, a := range addrs {
+			pi.Addrs = append(pi.Addrs, ma.StringCast(a.(string)))
+		}
 	}
 	return nil
 }
-- 
GitLab