From 27253eb0d022b8bcdb975d5d68e6a7cf87785b7e Mon Sep 17 00:00:00 2001 From: Matt Joiner Date: Sat, 2 Dec 2017 10:01:27 +1100 Subject: [PATCH] Fix panic in Torrent.addrActive if there are closed connections Fixes #214 --- torrent.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 } } -- 2.48.1