IJPL-203958 Fixed exception in suggested plugins dialog

GitOrigin-RevId: 735ea730830b5422617895fefd4a6f19984cfa1c
This commit is contained in:
Denis Zaichenko
2025-09-02 12:43:48 +00:00
committed by intellij-monorepo-bot
parent 6c51e2f6f9
commit b286322ddd
@@ -7,6 +7,9 @@ import com.intellij.ide.plugins.newui.MyPluginModel
import com.intellij.ide.plugins.newui.PluginDetailsPageComponent
import com.intellij.ide.plugins.newui.PluginModelFacade
import com.intellij.ide.plugins.newui.PluginUiModelAdapter
import com.intellij.openapi.application.EDT
import com.intellij.openapi.application.ModalityState
import com.intellij.openapi.application.asContextElement
import com.intellij.openapi.components.service
import com.intellij.openapi.extensions.PluginId
import com.intellij.openapi.project.Project
@@ -19,6 +22,7 @@ import com.intellij.ui.*
import com.intellij.ui.components.labels.LinkListener
import com.intellij.util.ui.JBUI
import com.intellij.util.ui.UIUtil
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import java.awt.BorderLayout
import javax.swing.JComponent
@@ -71,7 +75,7 @@ internal class DetectedPluginsPanel(project: Project?) : OrderPanel<PluginDownlo
}
})
entryTable.getSelectionModel().addListSelectionListener {
service<CoreUiCoroutineScopeHolder>().coroutineScope.launch {
service<CoreUiCoroutineScopeHolder>().coroutineScope.launch(Dispatchers.EDT + ModalityState.stateForComponent(this).asContextElement()) {
val selectedRow = entryTable.selectedRow
if (selectedRow != -1) {
val plugin = getValueAt(selectedRow)!!.descriptor