Annotasiont[j] might be null
[jalview.git] / src / jalview / gui / AnnotationPanel.java
index dbc1c92..9fee829 100755 (executable)
@@ -1192,13 +1192,16 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 \r
       for (int j = sRes; j < eRes; j++)\r
       {\r
+        if (aa.annotations[j] != null)\r
+        {\r
           g.setColor(aa.annotations[j].colour);\r
 \r
-          height = (int) ((aa.annotations[j].value / aa.graphMax) * y);\r
-          if(height>y)\r
+          height = (int) ( (aa.annotations[j].value / aa.graphMax) * y);\r
+          if (height > y)\r
             height = y;\r
 \r
           g.fillRect(x, y - height, av.charWidth, height);\r
+        }\r
           x += av.charWidth;\r
       }\r
     }\r