ipn/ipnlocal: fix a nil pointer dereference when serving /localapi/v0/tka/status
Fixes #13330 Signed-off-by: Nick Khyl <nickk@tailscale.com>
This commit is contained in:
parent
3d9e3a17fa
commit
2f2aeaeaeb
|
@ -538,10 +538,13 @@ func (b *LocalBackend) NetworkLockStatus() *ipnstate.NetworkLockStatus {
|
|||
filtered[i] = b.tka.filtered[i].Clone()
|
||||
}
|
||||
|
||||
visible := make([]*ipnstate.TKAPeer, len(b.netMap.Peers))
|
||||
for i, p := range b.netMap.Peers {
|
||||
s := tkaStateFromPeer(p)
|
||||
visible[i] = &s
|
||||
var visible []*ipnstate.TKAPeer
|
||||
if b.netMap != nil {
|
||||
visible = make([]*ipnstate.TKAPeer, len(b.netMap.Peers))
|
||||
for i, p := range b.netMap.Peers {
|
||||
s := tkaStateFromPeer(p)
|
||||
visible[i] = &s
|
||||
}
|
||||
}
|
||||
|
||||
stateID1, _ := b.tka.authority.StateIDs()
|
||||
|
|
Loading…
Reference in New Issue