From 9fd659503c6a065d5f285183fea9fa6b92236aa5 Mon Sep 17 00:00:00 2001 From: robert-cronin Date: Thu, 12 Dec 2024 02:20:56 +0000 Subject: [PATCH] Add check for empty CertifyBad nodes in query bad Signed-off-by: robert-cronin --- cmd/guacone/cmd/bad.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cmd/guacone/cmd/bad.go b/cmd/guacone/cmd/bad.go index a721f1ca30..42c3c8c53d 100644 --- a/cmd/guacone/cmd/bad.go +++ b/cmd/guacone/cmd/bad.go @@ -65,6 +65,11 @@ var queryBadCmd = &cobra.Command{ logger.Fatalf("error querying for package: %v", err) } + if len(certifyBadResponse.CertifyBad) == 0 { + fmt.Println("No CertifyBad nodes found!") + return + } + mapCertifyBad := map[string][]model.CertifyBadCertifyBad{} for _, certifyBad := range certifyBadResponse.CertifyBad { switch subject := certifyBad.Subject.(type) {