From 651a9440a02b8237ad12387bb652711cc8ba34e3 Mon Sep 17 00:00:00 2001 From: jprocter Date: Wed, 28 Apr 2010 10:18:56 +0000 Subject: [PATCH] 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). --- src/jalview/gui/SeqPanel.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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); } -- 1.7.10.2