From: jprocter Date: Wed, 28 Apr 2010 10:18:56 +0000 (+0000) Subject: null pointer when double click event occurs without an existing selection (happens... X-Git-Tag: Release_2_5~40 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=651a9440a02b8237ad12387bb652711cc8ba34e3;p=jalview.git null pointer when double click event occurs without an existing selection (happens when tooltip position has been locked using shift key, and then user double clicks). --- diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index f260ec2..4036204 100755 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -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); }