Annotasiont[j] might be null
authoramwaterhouse <Andrew Waterhouse>
Thu, 12 Oct 2006 13:22:03 +0000 (13:22 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 12 Oct 2006 13:22:03 +0000 (13:22 +0000)
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