Fix NPE in KotlinRunConfiguration & do not throw exception on unknown container type (EA-209426)
This commit is contained in:
@@ -277,6 +277,7 @@ public class KotlinRunConfiguration extends JetRunConfiguration {
|
||||
|
||||
private void updateMainClassName(PsiElement element) {
|
||||
KtDeclarationContainer container = KotlinRunConfigurationProducer.Companion.getEntryPointContainer(element);
|
||||
if (container == null) return;
|
||||
String name = KotlinRunConfigurationProducer.Companion.getStartClassFqName(container);
|
||||
if (name != null) {
|
||||
MAIN_CLASS_NAME = name;
|
||||
|
||||
@@ -101,7 +101,7 @@ class KotlinRunConfigurationProducer : RunConfigurationProducer<KotlinRunConfigu
|
||||
container.toLightClass()?.let { ClassUtil.getJVMClassName(it) }
|
||||
}
|
||||
}
|
||||
else -> throw IllegalArgumentException("Invalid entry-point container: " + (container as PsiElement).text)
|
||||
else -> null
|
||||
}
|
||||
|
||||
private fun PsiElement.declarationContainer(strict: Boolean): KtDeclarationContainer? {
|
||||
|
||||
Reference in New Issue
Block a user