mirror of
https://github.com/tailscale/tailscale.git
synced 2025-01-08 09:07:44 +00:00
tailcfg: NetInfo.String: handle nil object without panicing
Signed-off-by: David Crawshaw <crawshaw@tailscale.com>
This commit is contained in:
parent
b6f77cc48d
commit
e60b433831
@ -286,6 +286,9 @@ type NetInfo struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (ni *NetInfo) String() string {
|
func (ni *NetInfo) String() string {
|
||||||
|
if ni == nil {
|
||||||
|
return "NetInfo(nil)"
|
||||||
|
}
|
||||||
return fmt.Sprintf("NetInfo{varies=%v hairpin=%v ipv6=%v udp=%v derp=#%v link=%q}",
|
return fmt.Sprintf("NetInfo{varies=%v hairpin=%v ipv6=%v udp=%v derp=#%v link=%q}",
|
||||||
ni.MappingVariesByDestIP, ni.HairPinning, ni.WorkingIPv6,
|
ni.MappingVariesByDestIP, ni.HairPinning, ni.WorkingIPv6,
|
||||||
ni.WorkingUDP, ni.PreferredDERP, ni.LinkType)
|
ni.WorkingUDP, ni.PreferredDERP, ni.LinkType)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user