From 1a01c85fe8d061b09264702c14d7baae6c32289e Mon Sep 17 00:00:00 2001 From: Cedric Beust Date: Sat, 28 Jan 2017 10:14:11 -0800 Subject: [PATCH] Bug due to weird behavior of split(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Somehow, “”.split(“ “) == arrayOf(“”). --- .../kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt index b1a967d3..6def1f05 100644 --- a/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt +++ b/src/main/kotlin/com/beust/kobalt/plugin/kotlin/KotlinCompiler.kt @@ -95,8 +95,7 @@ class KotlinCompiler @Inject constructor( .joinToString(File.pathSeparator) val xFlagsString = kotlinConfig(project)?.args?.joinToString(" ") ?: settings.kobaltCompilerFlags - ?: "" - val xFlagsArray = xFlagsString.split(" ").toTypedArray() + val xFlagsArray = xFlagsString?.split(" ")?.toTypedArray() ?: emptyArray() val newArgs = listOf( "-classpath", compilerClasspath, K2JVMCompiler::class.java.name,