From 51e3280b186f53135fd15b9e38ca36d81fb1d2ec Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 10 Sep 2018 10:34:21 +0100 Subject: [PATCH] JAL-3108 fix concurrency bug in Reveal action handler --- src/jalview/gui/ScalePanel.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index e6bba02..5601c7a 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -158,7 +158,12 @@ public class ScalePanel extends JPanel protected void rightMouseButtonPressed(MouseEvent evt, final int res) { JPopupMenu pop = new JPopupMenu(); - if (reveal != null) + + /* + * grab the hidden range in case mouseMoved nulls it + */ + final int[] hiddenRange = reveal; + if (hiddenRange != null) { JMenuItem item = new JMenuItem( MessageManager.getString("label.reveal")); @@ -167,7 +172,7 @@ public class ScalePanel extends JPanel @Override public void actionPerformed(ActionEvent e) { - av.showColumn(reveal[0]); + av.showColumn(hiddenRange[0]); reveal = null; ap.paintAlignment(true, true); av.sendSelection(); -- 1.7.10.2