From 2a0747d42d61f77d2365b61a72973bf10a3dda1d Mon Sep 17 00:00:00 2001 From: Hugo Arregui Date: Fri, 6 Sep 2019 08:51:32 -0300 Subject: [PATCH] Fix connection nil pointer Don't assume connection is present if there is an error in listenUDP --- gather.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gather.go b/gather.go index 6513934..a540c3b 100644 --- a/gather.go +++ b/gather.go @@ -244,7 +244,7 @@ func (a *Agent) gatherCandidatesSrflx(urls []*URL, networkTypes []NetworkType) { conn, err := a.listenUDP(int(a.portmax), int(a.portmin), network, &net.UDPAddr{IP: nil, Port: 0}) if err != nil { - a.log.Warnf("Failed to listen on %s for %s: %v\n", conn.LocalAddr().String(), serverAddr.String(), err) + a.log.Warnf("Failed to listen for %s: %v\n", serverAddr.String(), err) continue }