From 56da868a05f0014382d34aecf282db867ee67f1d Mon Sep 17 00:00:00 2001 From: Eliezer Graber Date: Sun, 8 Nov 2020 17:20:13 -0500 Subject: [PATCH] Fix a crash when building using Gradle 6.6+ --- .../desktop/application/internal/configureApplication.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt index 4f044af03d..a9fc466ef9 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/internal/configureApplication.kt @@ -155,7 +155,8 @@ private fun Project.configureRunTask(app: Application) { args = app.args val cp = objects.fileCollection() - cp.from(app.mainJar.orNull) + // adding a null value will cause future invocations of `from` to throw an NPE + app.mainJar.orNull?.let(cp::from) cp.from(app._fromFiles) dependsOn(*app._dependenciesTaskNames.toTypedArray())