fix for #757
This commit is contained in:
parent
d2544da530
commit
9c83bd0959
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue