From 6147481b4086e937ddf91b8a829315a714cc89f9 Mon Sep 17 00:00:00 2001 From: Alex Snaps Date: Tue, 15 Oct 2024 10:29:04 -0400 Subject: [PATCH] Deal with nil expression.Value as "" --- pkg/evaluators/authorization/kubernetes_authz.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/evaluators/authorization/kubernetes_authz.go b/pkg/evaluators/authorization/kubernetes_authz.go index 613a7778..947327ea 100644 --- a/pkg/evaluators/authorization/kubernetes_authz.go +++ b/pkg/evaluators/authorization/kubernetes_authz.go @@ -64,6 +64,9 @@ func (k *KubernetesAuthz) Call(pipeline auth.AuthPipeline, ctx gocontext.Context authJSON := pipeline.GetAuthorizationJSON() jsonValueToStr := func(value expressions.Value) (string, error) { + if value == nil { + return "", nil + } resolved, err := value.ResolveFor(authJSON) if err != nil { return "", err