From d8cfce9066d94d620f73ebe4abffa2c48d89b310 Mon Sep 17 00:00:00 2001 From: anthonyharrison Date: Tue, 20 Aug 2024 22:16:10 +0100 Subject: [PATCH] fix: license handling --- lib4sbom/cyclonedx/cyclonedx_parser.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib4sbom/cyclonedx/cyclonedx_parser.py b/lib4sbom/cyclonedx/cyclonedx_parser.py index 76fed4c..8adb543 100644 --- a/lib4sbom/cyclonedx/cyclonedx_parser.py +++ b/lib4sbom/cyclonedx/cyclonedx_parser.py @@ -298,7 +298,8 @@ def _cyclondex_component(self, d): if "licenses" in d: license_data = self.process_license(d["licenses"]) elif "evidence" in d: - license_data = self.process_license(d["evidence"]) + if "licenses" in d["evidence"]: + license_data = self.process_license(d["evidence"]["licenses"]) if license_data is not None and len(license_data) > 0: # Multiple ways of defining licenses for license_info in license_data: