Skip to content

Commit

Permalink
Merge pull request #104 from rback123/patch-103
Browse files Browse the repository at this point in the history
Prevent crash when package_license is none from pypi null value
  • Loading branch information
coderpatros authored Sep 8, 2020
2 parents 3c8b583 + 6b18250 commit 57e31f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cyclonedx/bom/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def get_component(req, package_info_url=DEFAULT_PACKAGE_INFO_URL):
component.description = package_info["info"]["summary"]
# TODO: Attempt to perform SPDX license ID resolution
package_license = package_info["info"]["license"]
if package_license != 'UNKNOWN' and len(package_license.strip()) > 0:
if package_license and package_license != 'UNKNOWN' and len(package_license.strip()) > 0:
license = License(name=package_license)
component_license = ComponentLicense(license=license)
component.licenses.append(component_license)
Expand Down

0 comments on commit 57e31f0

Please sign in to comment.