From e334f0143a0fd0a77e53ec8f9fec7ce3c60c355a Mon Sep 17 00:00:00 2001 From: jigisha620 Date: Mon, 3 Feb 2025 10:16:19 -0800 Subject: [PATCH] chore: fix nil pointer dereference --- pkg/controllers/state/cluster.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/controllers/state/cluster.go b/pkg/controllers/state/cluster.go index feb222e00a..3c0bf69d39 100644 --- a/pkg/controllers/state/cluster.go +++ b/pkg/controllers/state/cluster.go @@ -547,7 +547,7 @@ func (c *Cluster) newStateFromNode(ctx context.Context, node *corev1.Node, oldNo func (c *Cluster) cleanupNode(name string) { if id := c.nodeNameToProviderID[name]; id != "" { - if c.nodes[id].NodeClaim == nil { + if c.nodes[id] != nil && c.nodes[id].NodeClaim == nil { delete(c.nodes, id) } else { c.nodes[id].Node = nil