Fix connection nil pointer

Don't assume connection is present if there is an error in listenUDP
This commit is contained in:
Hugo Arregui
2019-09-07 02:42:10 -04:00
committed by Sean DuBois
parent 953f36f07f
commit 2a0747d42d
+1 -1
View File
@@ -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
}