From 889afbfbc4268e51b0f07479ba1946e64eef0cc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Kukie=C5=82ka?= Date: Wed, 22 May 2024 13:26:37 +0200 Subject: [PATCH] Fix error of project alredy disposed (#1585) ## Test plan Quickly switch projects multiple times to reproduce the issue. --- .../com/sourcegraph/cody/listeners/CodyFileEditorListener.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/kotlin/com/sourcegraph/cody/listeners/CodyFileEditorListener.kt b/src/main/kotlin/com/sourcegraph/cody/listeners/CodyFileEditorListener.kt index bf2383f9d7cf..7b89ad95dc19 100644 --- a/src/main/kotlin/com/sourcegraph/cody/listeners/CodyFileEditorListener.kt +++ b/src/main/kotlin/com/sourcegraph/cody/listeners/CodyFileEditorListener.kt @@ -60,6 +60,7 @@ class CodyFileEditorListener : FileEditorManagerListener { } } + if (project.isDisposed) return@invokeLater FileEditorManager.getInstance(project).selectedTextEditor?.let { editor -> val file = fileDocumentManager.getFile(editor.document) try {