Skip to content

Commit

Permalink
fix: license handling in CycloneDX
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyharrison committed Aug 29, 2024
1 parent ab7150c commit bf7c89a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sbomdiff/cyclonedx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def parse_cyclonedx_json(self, sbom_file):
# Multiple ways of defining license data
if "licenses" in d and len(d["licenses"]) > 0:
license_data = d["licenses"][0]
elif "evidence" in d and len(d["evidence"]["licenses"]) > 0:
license_data = d["evidence"]["licenses"][0]
elif "evidence" in d:
if "licenses" in d["evidence"]:
license_data = d["evidence"]["licenses"]
if license_data is not None:
license = None
if "license" in license_data:
Expand Down

0 comments on commit bf7c89a

Please sign in to comment.