check for null residues
authoramwaterhouse <Andrew Waterhouse>
Thu, 26 May 2005 09:54:29 +0000 (09:54 +0000)
committeramwaterhouse <Andrew Waterhouse>
Thu, 26 May 2005 09:54:29 +0000 (09:54 +0000)
src/jalview/appletgui/AnnotationPanel.java
src/jalview/gui/AnnotationPanel.java

index 6a1e58b..2cf5beb 100755 (executable)
@@ -253,7 +253,10 @@ public class AnnotationPanel extends Panel implements AdjustmentListener
 \r
       for(j=startRes; j<endRes; j++)\r
       {\r
-        validRes = row.annotations[j]==null?false:true;\r
+        if(row.annotations.length<=j || row.annotations[j]==null)\r
+        validRes = false;\r
+       else\r
+         validRes = true;\r
 \r
        x = (j-startRes)*av.charWidth;\r
 \r
index 77f557b..b8d35dc 100755 (executable)
@@ -432,7 +432,10 @@ public class AnnotationPanel extends JPanel implements MouseListener, MouseMotio
 \r
       for(j=startRes; j<endRes; j++)\r
       {\r
-        validRes = row.annotations[j]==null?false:true;\r
+        if(row.annotations.length<=j || row.annotations[j]==null)\r
+        validRes = false;\r
+       else\r
+         validRes = true;\r
 \r
        x = (j-startRes)*av.charWidth;\r
 \r