Fix NSEE if there's no JVM implementation module (KT-20638)

This commit is contained in:
Dmitry Jemerov
2017-10-06 19:49:07 +02:00
parent dc7ffdcbe4
commit ee72cc268c
@@ -130,5 +130,5 @@ class KotlinRunConfigurationProducer : RunConfigurationProducer<KotlinRunConfigu
fun Module.findJvmImplementationModule(): Module? {
if (targetPlatform != TargetPlatformKind.Common) return null
val allDependentModules = ModuleManager.getInstance(project).getModuleDependentModules(this)
return allDependentModules.first { it.targetPlatform is TargetPlatformKind.Jvm }
return allDependentModules.firstOrNull { it.targetPlatform is TargetPlatformKind.Jvm }
}