From efd88c09f1b3d4e7b7a092571b9c76833f3d0cdc Mon Sep 17 00:00:00 2001 From: Blaize Kaye Date: Tue, 13 Aug 2024 21:00:53 +1200 Subject: [PATCH] Checks if facts from cdx component is nil --- internal/handler/insightsParserFilter.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/handler/insightsParserFilter.go b/internal/handler/insightsParserFilter.go index 8c3de48..27b9878 100644 --- a/internal/handler/insightsParserFilter.go +++ b/internal/handler/insightsParserFilter.go @@ -68,7 +68,7 @@ func processSbomInsightsData(h *Messaging, insights InsightsData, v string, apiC func processFactsFromSBOM(logger *slog.Logger, facts *[]cdx.Component, environmentId int, source string) []LagoonFact { var factsInput []LagoonFact - if len(*facts) == 0 { + if facts == nil || len(*facts) == 0 { return factsInput }