Tools__CodeView2.st
changeset 16910 83403af26b43
parent 16890 8b4fad7fb72d
child 16968 db7d639de0e8
child 17133 f9f20407fbf9
--- a/Tools__CodeView2.st	Thu Oct 06 00:27:51 2016 +0200
+++ b/Tools__CodeView2.st	Thu Oct 06 13:31:09 2016 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
               All Rights Reserved
@@ -1092,7 +1094,7 @@
     "this changes the scroller's background, to show the positions of
      warnings, for easy location of interesting spots"
      
-    |allAnnotations allBreakpoints scroller newBackground|
+    |allAnnotations allBreakpoints scroller newBackground verticalScrollBar|
 
     allAnnotations := OrderedCollection new.
     allBreakpoints := OrderedCollection new.
@@ -1103,19 +1105,31 @@
         ].    
     ].
 
-    scroller := textViewScroller verticalScrollBar thumb.
+    verticalScrollBar := textViewScroller verticalScrollBar.
+    verticalScrollBar notNil ifTrue:[
+        scroller := verticalScrollBar thumb.
+    ].
+
     (allAnnotations isEmpty and:[allBreakpoints isEmpty]) ifTrue:[
         "/ nothing special to show
-        scroller viewBackground isColor ifTrue:[^ self].
-        scroller initStyle
+        scroller notNil ifTrue:[
+            scroller viewBackground isColor ifTrue:[^ self].
+            scroller initStyle
+        ].
     ] ifFalse:[
         "/ yep, there are some annotations
         newBackground := AnnotationShowingScrollerBackground new.
         newBackground textView:textView.
         newBackground annotations:allAnnotations; breakpoints:allBreakpoints.
-        scroller viewBackground:newBackground.
+
+        scroller notNil ifTrue:[
+            scroller viewBackground:newBackground.
+        ].
     ].
-    scroller invalidate.
+
+    scroller notNil ifTrue:[
+        scroller invalidate.
+    ].
 ! !
 
 !CodeView2 methodsFor:'channels'!