Skip to content

Commit 01da06c

Browse files
committed
refactor: Correctly cast EditorEx to avoid null pointer exception.
1 parent 021f22c commit 01da06c

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

src/main/kotlin/cc/unitmesh/devti/gui/chat/AutoDevInputSection.kt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,9 @@ class AutoDevInputSection(private val project: Project, val disposable: Disposab
165165
}
166166

167167
fun initEditor() {
168-
val editorEx = when (this.input.editor) {
169-
is EditorEx -> this.input.editor
170-
else -> null
171-
} ?: return
168+
val editorEx = this.input.editor as? EditorEx ?: return
172169

173-
setBorder(AutoDevCoolBorder(editorEx as EditorEx, this))
170+
setBorder(AutoDevCoolBorder(editorEx, this))
174171
UIUtil.setOpaqueRecursively(this, false)
175172
this.revalidate()
176173
}

0 commit comments

Comments
 (0)