From 4b74189ba0ab9189f70a86e912fb7c42a0678c32 Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Thu, 12 Oct 2006 13:22:03 +0000 Subject: [PATCH] Annotasiont[j] might be null --- src/jalview/gui/AnnotationPanel.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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; } } -- 1.7.10.2