From 05e68c05227988d7a7b93361c16a15054e1f9429 Mon Sep 17 00:00:00 2001 From: Simon Ogorodnik Date: Mon, 24 Apr 2017 23:13:28 +0300 Subject: Fix NPE in gradle plugin --- runners/gradle-plugin/src/main/kotlin/main.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'runners/gradle-plugin/src') diff --git a/runners/gradle-plugin/src/main/kotlin/main.kt b/runners/gradle-plugin/src/main/kotlin/main.kt index e7c7b99a..959698c3 100644 --- a/runners/gradle-plugin/src/main/kotlin/main.kt +++ b/runners/gradle-plugin/src/main/kotlin/main.kt @@ -116,11 +116,10 @@ open class DokkaTask : DefaultTask() { } } - val COLORS_ENABLED_PROPERTY = "kotlin.colors.enabled" @TaskAction fun generate() { - val kotlinColorsEnabledBefore = System.getProperty(COLORS_ENABLED_PROPERTY) + val kotlinColorsEnabledBefore = System.getProperty(COLORS_ENABLED_PROPERTY) ?: "false" System.setProperty(COLORS_ENABLED_PROPERTY, "false") try { loadFatJar() @@ -208,6 +207,10 @@ open class DokkaTask : DefaultTask() { @OutputDirectory fun getOutputDirectoryAsFile(): File = project.file(outputDirectory) + + companion object { + const val COLORS_ENABLED_PROPERTY = "kotlin.colors.enabled" + } } open class LinkMapping : Serializable { -- cgit