Skip to content

Commit

Permalink
fix: Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyharrison committed Mar 23, 2023
1 parent 177bf90 commit 782a8d7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions sbomdiff/cyclonedx_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,18 @@ def parse_cyclonedx_json(self, sbom_file):
elif "evidence" in d and len(d["evidence"]["licenses"]) > 0:
license_data = d["evidence"]["licenses"][0]
if license_data is not None:
license = None
if "license" in license_data:
if "id" in license_data["license"]:
license = license_data["license"]["id"]
elif "name" in license_data["license"]:
license = license_data["license"]["name"]
elif "expression" in license_data["license"]:
license = license_data["license"]["expression"]
elif "expression" in license_data:
license = license_data["expression"]
if license is None:
license = "UNKNOWN"
if package not in packages:
packages[package] = [version, license]

Expand Down

0 comments on commit 782a8d7

Please sign in to comment.