panic parsing cyclonedx (#892)

This commit is contained in:
Keith Zantow 2022-03-16 09:10:44 -04:00 committed by GitHub
parent b9b3ccecf9
commit ee0a1d172c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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{