From dbf2faa4bf55410c530ec2eb2cc8fc0728d67a49 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Sun, 27 Oct 2024 12:56:56 -0400 Subject: [PATCH] fix nil in router Signed-off-by: Kristoffer Dalby --- hscontrol/policy/pm.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hscontrol/policy/pm.go b/hscontrol/policy/pm.go index a5d736bd..0e175557 100644 --- a/hscontrol/policy/pm.go +++ b/hscontrol/policy/pm.go @@ -165,6 +165,9 @@ func (pm *PolicyManagerV1) ApproversForRoute(route netip.Prefix) []string { // TODO(kradalby): This can be a parse error of the address in the policy, // in the new policy this will be typed and not a problem, in this policy // we will just return empty list + if pm.pol == nil { + return nil + } approvers, _ := pm.pol.AutoApprovers.GetRouteApprovers(route) return approvers }