#BUGFIX by mawalch
authormawalch
Wed, 01 Mar 2017 12:29:45 +0100
changeset 5508 6215fe395e12
parent 5507 a5c432b78ff6
child 5509 16997be94f7f
#BUGFIX by mawalch class: DoWhatIMeanSupport changed: #tryCodeCompletionWithSource:nodeInterval:at:mustBeExpression:into: Prevent exception (subscript out of bounds) if source is empty.
DoWhatIMeanSupport.st
--- a/DoWhatIMeanSupport.st	Mon Feb 27 23:41:56 2017 +0100
+++ b/DoWhatIMeanSupport.st	Wed Mar 01 12:29:45 2017 +0100
@@ -4414,7 +4414,7 @@
         node := nodeParent.
         nodeParent := node parent.
     ].
-    (characterPositionOfCursor-1) > source size ifTrue:[^ self].
+    (characterPositionOfCursor-1 max:1) > source size ifTrue:[^ self].
     characterBeforeCursor := source at:(characterPositionOfCursor-1 max:1). "/ codeView characterBeforeCursor.
     characterBeforeCursor isNil ifTrue:[ "at begin of line" ^ self].
     characterBeforeCursor == $. ifTrue:[ "at end of statement" ^ self].
@@ -4657,6 +4657,7 @@
 
     "Modified: / 04-07-2006 / 18:48:26 / fm"
     "Modified: / 26-02-2017 / 12:56:01 / cg"
+    "Modified: / 01-03-2017 / 12:27:14 / mawalch"
 !
 
 withoutSelectorsUnlikelyFor:aClass from:selectorsArg forPartial:partialSelector