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

index 6d4d600..b563386 100755 (executable)
@@ -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
index be7a13b..57debe7 100755 (executable)
@@ -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