2
0
mirror of synced 2025-02-23 22:28:11 +00:00

Fix panic in Torrent.addrActive if there are closed connections

Fixes #214
This commit is contained in:
Matt Joiner 2017-12-02 10:01:27 +11:00
parent 47622fad36
commit 27253eb0d0

View File

@ -207,7 +207,11 @@ func (t *Torrent) addrActive(addr string) bool {
return true
}
for c := range t.conns {
if c.remoteAddr().String() == addr {
ra := c.remoteAddr()
if ra == nil {
continue
}
if ra.String() == addr {
return true
}
}