Prevent err when editing and overview drawing
[jalview.git] / src / jalview / appletgui / AnnotationPanel.java
index fbc98be..101bddf 100755 (executable)
@@ -1078,6 +1078,7 @@ public class AnnotationPanel
   public void drawGraph(Graphics g, AlignmentAnnotation aa, int width, int y,\r
                         int sRes, int eRes)\r
   {\r
+    eRes = Math.min(eRes, aa.annotations.length);\r
     g.setColor(Color.white);\r
     g.fillRect(0, 0, width, y);\r
     g.setColor(new Color(0, 0, 180));\r