Skip to content

Commit

Permalink
Check for project disposal before adapter.createInstance
Browse files Browse the repository at this point in the history
  • Loading branch information
jenna-h committed Jun 12, 2024
1 parent b231130 commit 1b23144
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,10 @@ class EditorNotificationsImpl(private val project: Project,
if (project.isDisposed) {
return@launch
}
val provider = adapter.createInstance<EditorNotificationProvider>(project) ?: continue
val provider = readAction {
// isDisposed is only valid within a read action; see documentation in ComponentManager.
if (project.isDisposed) null else adapter.createInstance<EditorNotificationProvider>(project)
} ?: continue

coroutineContext.ensureActive()

Expand Down

0 comments on commit 1b23144

Please sign in to comment.