ipn/ipnlocal: fix a nil pointer dereference when serving /localapi/v0/tka/status

Fixes #13330

Signed-off-by: Nick Khyl <nickk@tailscale.com>
dependabot/npm_and_yarn/cmd/tsconnect/micromatch-4.0.8
Nick Khyl 2 months ago committed by Nick Khyl
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…
Cancel
Save