Skip to content

Commit bf7c89a

Browse files
fix: license handling in CycloneDX
1 parent ab7150c commit bf7c89a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sbomdiff/cyclonedx_parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ def parse_cyclonedx_json(self, sbom_file):
3434
# Multiple ways of defining license data
3535
if "licenses" in d and len(d["licenses"]) > 0:
3636
license_data = d["licenses"][0]
37-
elif "evidence" in d and len(d["evidence"]["licenses"]) > 0:
38-
license_data = d["evidence"]["licenses"][0]
37+
elif "evidence" in d:
38+
if "licenses" in d["evidence"]:
39+
license_data = d["evidence"]["licenses"]
3940
if license_data is not None:
4041
license = None
4142
if "license" in license_data:

0 commit comments

Comments
 (0)