From aefad5cf5e1eae15fee0c569334045a09aa34020 Mon Sep 17 00:00:00 2001 From: Vladimir Dolzhenko Date: Mon, 6 Jan 2020 13:13:41 +0100 Subject: [PATCH] Module info has to be read under readAction in KotlinNativeABICompatibilityChecker #EA-220356 Fixed --- .../ide/konan/KotlinNativeABICompatibilityChecker.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/idea/idea-gradle-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeABICompatibilityChecker.kt b/idea/idea-gradle-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeABICompatibilityChecker.kt index 4a09061587e..aa38d7f29ce 100644 --- a/idea/idea-gradle-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeABICompatibilityChecker.kt +++ b/idea/idea-gradle-native/src/org/jetbrains/kotlin/ide/konan/KotlinNativeABICompatibilityChecker.kt @@ -11,6 +11,7 @@ import com.intellij.notification.NotificationType import com.intellij.openapi.Disposable import com.intellij.openapi.application.ApplicationManager import com.intellij.openapi.application.runInEdt +import com.intellij.openapi.application.runReadAction import com.intellij.openapi.components.ProjectComponent import com.intellij.openapi.progress.EmptyProgressIndicator import com.intellij.openapi.progress.ProgressIndicator @@ -67,7 +68,12 @@ class KotlinNativeABICompatibilityChecker(private val project: Project) : Projec ProgressManager.getInstance().runProcessWithProgressAsynchronously( object : Task.Backgroundable(project, BG_TASK_NAME) { override fun run(indicator: ProgressIndicator) { - val librariesToNotify = getLibrariesToNotifyAbout() + val librariesToNotify = runReadAction { + if (project.isDisposed) return@runReadAction emptyMap() + + getLibrariesToNotifyAbout() + } + if (project.isDisposed) return val notifications = prepareNotifications(librariesToNotify) notifications.forEach {