EA-215324: Fix "Module already disposed" in Scratch combo-box

This commit is contained in:
Yan Zhulanow
2019-11-13 20:55:24 +09:00
parent 3d17af0ada
commit 3534d4af36
2 changed files with 2 additions and 2 deletions
@@ -49,7 +49,7 @@ class ModulesComboBoxAction(private val scratchFile: ScratchFile) : LabeledCombo
override fun update(e: AnActionEvent) {
super.update(e)
val selectedModule = scratchFile.module
val selectedModule = scratchFile.module?.takeIf { !it.isDisposed }
e.presentation.apply {
icon = selectedModule?.let { ModuleType.get(it).icon }
@@ -49,7 +49,7 @@ class ModulesComboBoxAction(private val scratchFile: ScratchFile) : LabeledCombo
override fun update(e: AnActionEvent) {
super.update(e)
val selectedModule = scratchFile.module
val selectedModule = scratchFile.module?.takeIf { !it.isDisposed }
e.presentation.apply {
icon = selectedModule?.let { ModuleType.get(it).icon }