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 <[email protected]>
  • Loading branch information
sschuberth committed Jul 16, 2024
1 parent c0f405b commit 9fb67d6
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 9fb67d6

Please sign in to comment.