Skip to content

Commit b7028be

Browse files
authored
Merge pull request #135 from scanoss/bugfix/mdaloia/SP-2912-SCANOSS-PY-Incorrect-CycloneDX-license-format
[SP-2912] fix: cdx format error when license id is none
2 parents e34a56e + 60071c3 commit b7028be

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99
### Added
1010
- Upcoming changes...
1111

12+
## [1.28.2] - 2025-07-14
13+
### Fixed
14+
- Fix CycloneDX format when license id is None
15+
1216
## [1.28.1] - 2025-07-10
1317
### Added
1418
- Fix purls parsing on `crypto` subcommand
@@ -593,3 +597,4 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
593597
[1.27.1]: https://github.com/scanoss/scanoss.py/compare/v1.27.0...v1.27.1
594598
[1.28.0]: https://github.com/scanoss/scanoss.py/compare/v1.27.1...v1.28.0
595599
[1.28.1]: https://github.com/scanoss/scanoss.py/compare/v1.28.0...v1.28.1
600+
[1.28.2]: https://github.com/scanoss/scanoss.py/compare/v1.28.1...v1.28.2

src/scanoss/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@
2222
THE SOFTWARE.
2323
"""
2424

25-
__version__ = '1.28.1'
25+
__version__ = '1.28.2'

src/scanoss/cyclonedx.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,8 @@ def produce_from_json(self, data: json, output_file: str = None) -> tuple[bool,
219219
lic_set = set()
220220
for lic in licenses: # Get a unique set of licenses
221221
lc_id = lic.get('id')
222+
if not lc_id:
223+
continue
222224
spdx_id = self._spdx.get_spdx_license_id(lc_id)
223225
lic_set.add(spdx_id if spdx_id else lc_id)
224226
for lc_id in lic_set: # Store licenses for later inclusion

0 commit comments

Comments
 (0)