fix null pointer exception in redraw for short sequence associated annotation rows
authorjprocter <Jim Procter>
Tue, 27 Oct 2009 10:54:37 +0000 (10:54 +0000)
committerjprocter <Jim Procter>
Tue, 27 Oct 2009 10:54:37 +0000 (10:54 +0000)
src/jalview/appletgui/AnnotationPanel.java
src/jalview/gui/AnnotationPanel.java

index 825773f..38e0331 100755 (executable)
@@ -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)
         {
index d705367..c3984f2 100755 (executable)
@@ -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