Fix crash with conventional trackers when tcp and utp are disabled
Fixes #396.
This commit is contained in:
parent
8cf3ce187d
commit
d4430e89b6
14
client.go
14
client.go
|
@ -1323,13 +1323,15 @@ func (cl *Client) publicIp(peer net.IP) net.IP {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cl *Client) findListenerIp(f func(net.IP) bool) net.IP {
|
func (cl *Client) findListenerIp(f func(net.IP) bool) net.IP {
|
||||||
return addrIpOrNil(
|
l := cl.findListener(
|
||||||
cl.findListener(
|
func(l net.Listener) bool {
|
||||||
func(l net.Listener) bool {
|
return f(addrIpOrNil(l.Addr()))
|
||||||
return f(addrIpOrNil(l.Addr()))
|
},
|
||||||
},
|
|
||||||
).Addr(),
|
|
||||||
)
|
)
|
||||||
|
if l == nil {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
return addrIpOrNil(l.Addr())
|
||||||
}
|
}
|
||||||
|
|
||||||
// Our IP as a peer should see it.
|
// Our IP as a peer should see it.
|
||||||
|
|
Loading…
Reference in New Issue