don't try to add auto-import if user closed the project while the popup was displayed (EA-67037 - assert: ComponentManagerImpl.getComponent)

This commit is contained in:
Dmitry Jemerov
2015-09-18 20:36:13 +02:00
parent 7ae5506d99
commit 9b33721a98
@@ -108,7 +108,7 @@ public class KotlinAddImportAction(
override fun isAutoSelectionEnabled() = false
override fun onChosen(selectedValue: Variant?, finalChoice: Boolean): PopupStep<String>? {
if (selectedValue == null) return null
if (selectedValue == null || project.isDisposed) return null
if (finalChoice) {
addImport(selectedValue)
@@ -123,7 +123,7 @@ public class KotlinAddImportAction(
}
override fun onChosen(selectedValue: String?, finalChoice: Boolean): PopupStep<Any>? {
if (finalChoice) {
if (finalChoice && !project.isDisposed) {
AddImportAction.excludeFromImport(project, selectedValue)
}
return null