From: jprocter Date: Tue, 27 Oct 2009 10:54:37 +0000 (+0000) Subject: fix null pointer exception in redraw for short sequence associated annotation rows X-Git-Tag: Release_2_5~177 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=77ee0174127cb2fd3d817b010b5a36278dd37c45;p=jalview.git fix null pointer exception in redraw for short sequence associated annotation rows --- diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 825773f..38e0331 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -751,7 +751,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, x1 += av.charWidth / 2; } - if (row.annotations[column] == null + if (!validRes || row.annotations[column] == null || row.annotations[column].secondaryStructure != 'H') { g.fillArc((x * av.charWidth) - av.charWidth, y + 4 @@ -883,7 +883,7 @@ public class AnnotationPanel extends Panel implements AdjustmentListener, } } - if (row.graph > 0) + if (row.graph > 0 && row.graphHeight> 0) { if (row.graph == AlignmentAnnotation.LINE_GRAPH) { diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index d705367..c3984f2 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -959,7 +959,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, x1 += av.charWidth / 2; } - if (row.annotations[column] == null + if (!validRes || row.annotations[column] == null || row.annotations[column].secondaryStructure != 'H') { g.fillArc((x * av.charWidth) - av.charWidth, y + 4