diff --git a/src/main/kotlin/com/cognifide/gradle/common/CommonPlugin.kt b/src/main/kotlin/com/cognifide/gradle/common/CommonPlugin.kt index 752c6fb..14eadfa 100644 --- a/src/main/kotlin/com/cognifide/gradle/common/CommonPlugin.kt +++ b/src/main/kotlin/com/cognifide/gradle/common/CommonPlugin.kt @@ -44,7 +44,7 @@ class CommonPlugin : Plugin { */ private fun checkPathEnabled(project: Project): Boolean { val envVars = listOf("JENKINS_HOME") - if (envVars.any { System.getenv(it).isNotBlank() }) { + if (envVars.any { (System.getenv(it) ?: "").isNotBlank() }) { return false } diff --git a/src/main/kotlin/com/cognifide/gradle/common/build/PropertyParser.kt b/src/main/kotlin/com/cognifide/gradle/common/build/PropertyParser.kt index 5c453af..97e89e2 100644 --- a/src/main/kotlin/com/cognifide/gradle/common/build/PropertyParser.kt +++ b/src/main/kotlin/com/cognifide/gradle/common/build/PropertyParser.kt @@ -18,12 +18,12 @@ class PropertyParser(anyProject: Project) { return project.property(name).toString() } - val systemValue = System.getProperty(name) + val systemValue: String? = System.getProperty(name) if (systemValue != null) { return systemValue } - val envValue = System.getenv(name) + val envValue: String? = System.getenv(name) if (envValue != null) { return envValue }