mirror of
https://github.com/corda/corda.git
synced 2025-01-18 02:39:51 +00:00
Merge pull request #1544 from corda/m4ksio_gradle_no_o_fix
Avoid ArrayOutOfBound exception in Gradle
This commit is contained in:
commit
931ab120fc
@ -3,6 +3,7 @@ package net.corda.plugins
|
||||
import com.typesafe.config.*
|
||||
import net.corda.cordform.CordformNode
|
||||
import org.bouncycastle.asn1.x500.X500Name
|
||||
import org.bouncycastle.asn1.x500.RDN
|
||||
import org.bouncycastle.asn1.x500.style.BCStyle
|
||||
import org.gradle.api.Project
|
||||
import java.io.File
|
||||
@ -117,7 +118,12 @@ class Node(private val project: Project) : CordformNode() {
|
||||
}
|
||||
|
||||
val dirName = try {
|
||||
X500Name(name).getRDNs(BCStyle.O).first().first.value.toString()
|
||||
val o = X500Name(name).getRDNs(BCStyle.O)
|
||||
if (o.size > 0) {
|
||||
o.first().first.value.toString()
|
||||
} else {
|
||||
name
|
||||
}
|
||||
} catch(_ : IllegalArgumentException) {
|
||||
// Can't parse as an X500 name, use the full string
|
||||
name
|
||||
|
Loading…
Reference in New Issue
Block a user