Fix NPE in LookupCancelService$Reminiscence

#EA-228125 Fixed
This commit is contained in:
Vladimir Dolzhenko
2020-04-19 23:08:35 +02:00
committed by Vladimir Dolzhenko
parent 061bc9af07
commit 3d4c5b0091
2 changed files with 2 additions and 2 deletions
@@ -35,7 +35,7 @@ class LookupCancelService {
// forget about auto-popup cancellation when the caret is moved to the start or before it
private var editorListener: CaretListener? = object : CaretListener {
override fun caretPositionChanged(e: CaretEvent) {
if (!marker!!.isValid || editor.logicalPositionToOffset(e.newPosition) <= offset) {
if (marker != null && (!marker!!.isValid || editor.logicalPositionToOffset(e.newPosition) <= offset)) {
dispose()
}
}
@@ -45,7 +45,7 @@ class LookupCancelWatcher(val project: Project) : ProjectComponent {
// forget about auto-popup cancellation when the caret is moved to the start or before it
private var editorListener: CaretListener? = object : CaretListener {
override fun caretPositionChanged(e: CaretEvent) {
if (!marker!!.isValid || editor.logicalPositionToOffset(e.newPosition) <= offset) {
if (marker != null && (!marker!!.isValid || editor.logicalPositionToOffset(e.newPosition) <= offset)) {
dispose()
}
}