#BUGFIX by exept
authorClaus Gittinger <cg@exept.de>
Fri, 20 Sep 2019 15:35:57 +0200
changeset 6711 1b1833b56e01
parent 6710 1309dd75d7f5
child 6712 293d6dde8845
#BUGFIX by exept class: EditTextViewCompletionSupport changed: #openCompletionView: race
EditTextViewCompletionSupport.st
--- a/EditTextViewCompletionSupport.st	Fri Sep 20 14:19:34 2019 +0200
+++ b/EditTextViewCompletionSupport.st	Fri Sep 20 15:35:57 2019 +0200
@@ -449,11 +449,15 @@
 openCompletionView: list
     "Makes sure the completion view is opened and with given `list`."
     
-    | textCursorPosInTextView textCursorPosOnScreen movePos topView|
+    |cursorX cursorY textCursorPosInTextView textCursorPosOnScreen movePos topView|
+
+    cursorX := editView xOfCursor.
+    cursorY := editView yOfCursor.
+    (cursorX isNil or:[cursorY isNil]) ifTrue:[^ self].
 
     "/ move the window away from the text cursor (to not cover what user types in)
     "/ get the screen-relative position of the text cursor
-    textCursorPosInTextView := editView xOfCursor @ editView yOfCursor.
+    textCursorPosInTextView := cursorX @ cursorY.
     
     "/ care for the scroll-offset (xOfCursor/yOFCursor gives me               
     textCursorPosInTextView := textCursorPosInTextView - (editView viewOrigin x @ 0).