From b40222a236d7debdaccb3b97b9162f9023f78be3 Mon Sep 17 00:00:00 2001 From: Frank Schoenmann Date: Sat, 23 Nov 2024 19:58:50 +0100 Subject: [PATCH] fix: conversion of supplier without contact list (#364) Signed-off-by: Frank Schoenmann <687230+fschoenm@users.noreply.github.com> Co-authored-by: Frank Schoenmann <687230+fschoenm@users.noreply.github.com> --- .../Converters/v2_2/Helpers/SpdxDocumentHelpers.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CycloneDX.Spdx.Interop/Converters/v2_2/Helpers/SpdxDocumentHelpers.cs b/src/CycloneDX.Spdx.Interop/Converters/v2_2/Helpers/SpdxDocumentHelpers.cs index 1acaed83..5d8cf150 100644 --- a/src/CycloneDX.Spdx.Interop/Converters/v2_2/Helpers/SpdxDocumentHelpers.cs +++ b/src/CycloneDX.Spdx.Interop/Converters/v2_2/Helpers/SpdxDocumentHelpers.cs @@ -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(); var supplierEmail = supplierEmails.Count > 0 ? supplierEmails.First().Email : ""; if (component.Supplier.Name == component.Properties?.GetSpdxElement(PropertyTaxonomy.PACKAGE_SUPPLIER_ORGANIZATION)) {