Skip to content

Commit d400938

Browse files
committed
Fix crash after enabling MANIFEST parsing
1 parent ddafd98 commit d400938

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugins/license-gather-plugin/src/main/kotlin/com/github/vlsi/gradle/license/GatherLicenseTask.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,7 +500,11 @@ open class GatherLicenseTask @Inject constructor(
500500
)
501501
JarFile(file).use { jar ->
502502
val bundleLicense = jar.manifest.mainAttributes.getValue("Bundle-License")
503-
val license = bundleLicense?.substringBefore(";")?.let {
503+
if (bundleLicense == null || bundleLicense.startsWith("http://") || bundleLicense.startsWith("https://")) {
504+
// Ignore URLs here as it will fail during parsing
505+
return
506+
}
507+
val license = bundleLicense.substringBefore(";")?.let {
504508
licenseExpressionParser.parse(it)
505509
}
506510
if (license != null) {

0 commit comments

Comments
 (0)