avoid NPE for null annotation element columns JAL-896
authorjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 11 Aug 2011 08:13:33 +0000 (09:13 +0100)
committerjprocter <jprocter@compbio.dundee.ac.uk>
Thu, 11 Aug 2011 08:13:33 +0000 (09:13 +0100)
src/jalview/gui/AnnotationPanel.java

index ca9b95f..0e90a5e 100755 (executable)
@@ -1067,7 +1067,8 @@ public class AnnotationPanel extends JPanel implements MouseListener,
         }
         if (row.hasIcons)
         {
-          char ss = row.annotations[column].secondaryStructure;
+          char ss = validRes ? row.annotations[column].secondaryStructure
+                  : ' ';
           if (ss == 'S')
           {
             // distinguish between forward/backward base-pairing
@@ -1120,11 +1121,9 @@ public class AnnotationPanel extends JPanel implements MouseListener,
             }
           }
         }
-
         column++;
         x++;
       }
-
       if (column >= row.annotations.length)
       {
         column = row.annotations.length - 1;