From: amwaterhouse Date: Thu, 12 Oct 2006 13:22:03 +0000 (+0000) Subject: Annotasiont[j] might be null X-Git-Tag: Release_2_2~279 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=4b74189ba0ab9189f70a86e912fb7c42a0678c32;p=jalview.git Annotasiont[j] might be null --- diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index dbc1c92..9fee829 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -1192,13 +1192,16 @@ public class AnnotationPanel extends JPanel implements MouseListener, for (int j = sRes; j < eRes; j++) { + if (aa.annotations[j] != null) + { g.setColor(aa.annotations[j].colour); - height = (int) ((aa.annotations[j].value / aa.graphMax) * y); - if(height>y) + height = (int) ( (aa.annotations[j].value / aa.graphMax) * y); + if (height > y) height = y; g.fillRect(x, y - height, av.charWidth, height); + } x += av.charWidth; } }