From 15938629ee84429b749701ed89aa81f6ea8940bd Mon Sep 17 00:00:00 2001 From: jprocter Date: Tue, 27 Oct 2009 10:52:55 +0000 Subject: [PATCH] fix null pointer exception in redraw for short sequence associated annotation rows --- src/jalview/appletgui/AnnotationPanel.java | 2 +- src/jalview/gui/AnnotationPanel.java | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 -- 1.7.10.2