Skip to content

Commit 67f56e7

Browse files
authored
fix(EnvironmentParser): reduced crashes if no Classifiers are found (#441)
fixes #440 Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com>
1 parent b7d5a4e commit 67f56e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cyclonedx_py/parser/environment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ def __init__(self, use_purl_bom_ref: bool = False) -> None:
7575
# Therefore, just go with a named license.
7676
c.licenses.add(LicenseChoice(license_=License(license_name=i_metadata['License'])))
7777

78-
for classifier in i_metadata.get_all("Classifier"):
78+
for classifier in i_metadata.get_all("Classifier", []):
7979
# Trove classifiers - https://packaging.python.org/specifications/core-metadata/#metadata-classifier
8080
# Full list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
8181
if str(classifier).startswith('License :: OSI Approved :: '):

0 commit comments

Comments
 (0)