Skip to content

Commit

Permalink
fix: conversion of supplier without contact list (#364)
Browse files Browse the repository at this point in the history
Signed-off-by: Frank Schoenmann <[email protected]>
Co-authored-by: Frank Schoenmann <[email protected]>
  • Loading branch information
fschoenm and fschoenm authored Nov 23, 2024
1 parent a40ae70 commit b40222a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public static void AddCycloneDXComponents(this SpdxDocument doc, Bom bom)
package.Supplier = component.Properties?.GetSpdxElement(PropertyTaxonomy.PACKAGE_SUPPLIER) ?? "NOASSERTION";
if (component.Supplier != null)
{
var supplierEmails = component.Supplier.Contact.Where(c => c.Email != null).ToList();
var supplierEmails = component.Supplier.Contact?.Where(c => c.Email != null).ToList() ?? new List<OrganizationalContact>();
var supplierEmail = supplierEmails.Count > 0 ? supplierEmails.First().Email : "";
if (component.Supplier.Name == component.Properties?.GetSpdxElement(PropertyTaxonomy.PACKAGE_SUPPLIER_ORGANIZATION))
{
Expand Down

0 comments on commit b40222a

Please sign in to comment.