From: jprocter Date: Tue, 27 Oct 2009 10:52:55 +0000 (+0000) Subject: fix null pointer exception in redraw for short sequence associated annotation rows X-Git-Tag: Jalview_2_4_0b2~13 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=15938629ee84429b749701ed89aa81f6ea8940bd;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 6d4d600..b563386 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -720,7 +720,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 diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index be7a13b..57debe7 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -542,7 +542,7 @@ public class AnnotationPanel extends JPanel implements MouseListener, res = av.getColumnSelection().adjustForHiddenColumns(res); } - if (aa[row].annotations != null && row > -1 + if (row > -1 && aa[row].annotations != null && res < (int) aa[row].annotations.length) { if (aa[row].graphGroup > -1) @@ -953,7 +953,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