From: Matt Joiner Date: Fri, 1 Dec 2017 23:01:27 +0000 (+1100) Subject: Fix panic in Torrent.addrActive if there are closed connections X-Git-Tag: v1.0.0~319 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=27253eb0d022b8bcdb975d5d68e6a7cf87785b7e;p=btrtrc.git Fix panic in Torrent.addrActive if there are closed connections Fixes #214 --- diff --git a/torrent.go b/torrent.go index 4c5fd153..d6846dbe 100644 --- a/torrent.go +++ b/torrent.go @@ -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 } }