Skip to content

Commit 800640b

Browse files
committed
refactor: add exception handling to chat panel removal
1 parent 30a98ce commit 800640b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

core/src/main/kotlin/cc/unitmesh/devti/inline/AutoDevInlineChatService.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,14 @@ class AutoDevInlineChatService : Disposable, SimpleDevinPrompter() {
5858

5959
chatPanel.dispose()
6060

61-
editor.contentComponent.remove(chatPanel)
62-
editor.contentComponent.revalidate()
63-
editor.contentComponent.repaint()
64-
allChats.remove(editor.fileUrl())
61+
try {
62+
editor.contentComponent.remove(chatPanel)
63+
editor.contentComponent.revalidate()
64+
editor.contentComponent.repaint()
65+
allChats.remove(editor.fileUrl())
66+
} catch (e: Exception) {
67+
e.printStackTrace()
68+
}
6569
}
6670

6771
companion object {

0 commit comments

Comments
 (0)