tracker/peer.go | 4 +++- diff --git a/tracker/peer.go b/tracker/peer.go index 44d61e82882845dc92017c6ce71ef2559ed876ec..6f13c569c2b664de487f5a1250ccb781cbf74ab7 100644 --- a/tracker/peer.go +++ b/tracker/peer.go @@ -15,7 +15,9 @@ // Set from the non-compact form in BEP 3. func (p *Peer) fromDictInterface(d map[string]interface{}) { p.IP = net.ParseIP(d["ip"].(string)) - p.ID = []byte(d["peer id"].(string)) + if _, ok := d["peer id"]; ok { + p.ID = []byte(d["peer id"].(string)) + } p.Port = int(d["port"].(int64)) }