Skip to content

Commit

Permalink
fix(cyclonedx): Only set licenses at all if they are not empty
Browse files Browse the repository at this point in the history
This works around [1] and resolves #8857.

[1]: CycloneDX/cyclonedx-core-java#439

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Jul 16, 2024
1 parent da70ac4 commit 023dfb6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ class CycloneDxReporter : Reporter {

hashes = listOfNotNull(hash)

licenses = LicenseChoice().apply { licenses = licenseObjects }
if (licenseObjects.isNotEmpty()) licenses = LicenseChoice().apply { licenses = licenseObjects }

// TODO: Find a way to associate copyrights to the license they belong to, see
// https://github.com/CycloneDX/cyclonedx-core-java/issues/58
Expand Down

0 comments on commit 023dfb6

Please sign in to comment.