From 4ca8373ac2a311cc825bc72fce782ee61dcece2d Mon Sep 17 00:00:00 2001 From: "Jose I. Paris" Date: Mon, 30 Mar 2026 21:33:51 +0200 Subject: [PATCH] fix(policies): skip GetEvaluableContent when no policies apply to material Closes #2963 Signed-off-by: Jose I. Paris --- pkg/policies/policy_groups.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/policies/policy_groups.go b/pkg/policies/policy_groups.go index 6822db3d6..85360624d 100644 --- a/pkg/policies/policy_groups.go +++ b/pkg/policies/policy_groups.go @@ -77,6 +77,11 @@ func (pgv *PolicyGroupVerifier) VerifyMaterial(ctx context.Context, material *ap return nil, NewPolicyError(err) } + // Skip loading content if no policies apply to this material + if len(policyAtts) == 0 { + continue + } + // Load material content once for all policies in this group subject, err := material.GetEvaluableContent(path) if err != nil {