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