-1 error
authoramwaterhouse <Andrew Waterhouse>
Fri, 27 Oct 2006 16:15:58 +0000 (16:15 +0000)
committeramwaterhouse <Andrew Waterhouse>
Fri, 27 Oct 2006 16:15:58 +0000 (16:15 +0000)
src/jalview/gui/AnnotationPanel.java

index 844c1ab..417eb8c 100755 (executable)
@@ -509,12 +509,17 @@ public class AnnotationPanel extends JPanel implements MouseListener,
             }\r
         }\r
 \r
+        if(row==-1)\r
+          return;\r
+\r
         int res = (evt.getX() / av.getCharWidth()) + av.getStartRes();\r
 \r
         if(av.hasHiddenColumns)\r
           res = av.getColumnSelection().adjustForHiddenColumns(res);\r
 \r
-        if (row > -1 && res<aa[row].annotations.length)\r
+        if ( aa[row].annotations!=null\r
+             && row > -1\r
+             && res < (int) aa[row].annotations.length)\r
         {\r
             if(aa[row].graphGroup>-1)\r
             {\r