Check row.annotations is not null
authoramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 12:56:13 +0000 (12:56 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 7 Jul 2006 12:56:13 +0000 (12:56 +0000)
src/jalview/appletgui/AnnotationPanel.java

index 71f51ea..614498c 100755 (executable)
@@ -467,6 +467,9 @@ public class AnnotationPanel
           column++;\r
           }\r
 \r
+          if(column>=row.annotations.length)\r
+              column = row.annotations.length-1;\r
+\r
           x += av.charWidth;\r
 \r
           if (row.hasIcons)\r
@@ -511,8 +514,8 @@ public class AnnotationPanel
               case 'E':\r
                   g.setColor(SHEET_COLOUR);\r
 \r
-                  if (row.annotations.length > endRes\r
-                      && row.annotations[endRes].secondaryStructure != 'E')\r
+                  if (row.annotations[endRes] ==null\r
+                        || row.annotations[endRes].secondaryStructure != 'E')\r
                   {\r
                     g.fillRect(lastSSX, y + 4 + iconOffset,\r
                                x - lastSSX - 4, 7);\r