From ee0a1d172c0c6f0da907694b9b48870b33d2852d Mon Sep 17 00:00:00 2001 From: Keith Zantow Date: Wed, 16 Mar 2022 09:10:44 -0400 Subject: [PATCH] panic parsing cyclonedx (#892) --- internal/formats/common/cyclonedxhelpers/component.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/formats/common/cyclonedxhelpers/component.go b/internal/formats/common/cyclonedxhelpers/component.go index 27b26d236..0815fff16 100644 --- a/internal/formats/common/cyclonedxhelpers/component.go +++ b/internal/formats/common/cyclonedxhelpers/component.go @@ -47,8 +47,10 @@ func hasMetadata(p pkg.Package) bool { func decodeComponent(c *cyclonedx.Component) *pkg.Package { values := map[string]string{} - for _, p := range *c.Properties { - values[p.Name] = p.Value + if c.Properties != nil { + for _, p := range *c.Properties { + values[p.Name] = p.Value + } } p := &pkg.Package{