null pointer when double click event occurs without an existing selection (happens...
authorjprocter <Jim Procter>
Wed, 28 Apr 2010 10:18:56 +0000 (10:18 +0000)
committerjprocter <Jim Procter>
Wed, 28 Apr 2010 10:18:56 +0000 (10:18 +0000)
src/jalview/gui/SeqPanel.java

index f260ec2..4036204 100755 (executable)
@@ -1425,12 +1425,14 @@ public class SeqPanel extends JPanel implements MouseListener,
 
   public void mouseClicked(MouseEvent evt)
   {
+    SequenceGroup sg=null;
     SequenceI sequence = av.alignment.getSequenceAt(findSeq(evt));
     if (evt.getClickCount() > 1)
     {
-      if (av.getSelectionGroup().getSize() == 1
-              && av.getSelectionGroup().getEndRes()
-                      - av.getSelectionGroup().getStartRes() < 2)
+      sg = av.getSelectionGroup();
+      if (sg!=null && sg.getSize() == 1
+              && sg.getEndRes()
+                      - sg.getStartRes() < 2)
       {
         av.setSelectionGroup(null);
       }