From 519ec6feac9ad2405b27bb8221c7ebdfa4123fad Mon Sep 17 00:00:00 2001 From: Ivan Milchev Date: Tue, 30 Apr 2024 09:44:52 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20junit=20reporter=20panic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ivan Milchev --- cli/reporter/junit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cli/reporter/junit.go b/cli/reporter/junit.go index 4304657d..c58e9733 100644 --- a/cli/reporter/junit.go +++ b/cli/reporter/junit.go @@ -50,6 +50,10 @@ func ConvertToJunit(r *policy.ReportCollection, out shared.OutputHelper) error { suites.Suites = append(suites.Suites, ts) } + if r.Bundle == nil { + return fmt.Errorf("no policy bundle found") + } + bundle := r.Bundle.ToMap() queries := bundle.QueryMap()