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())