From: gmungoc Date: Wed, 8 Nov 2017 11:33:43 +0000 (+0000) Subject: JAL-2069 ensure threshline instantiated to avoid NPE X-Git-Tag: Release_2_11_0~140 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=b8fb96caffa663ff3c3ea391aedc591aaa8acbe3;p=jalview.git JAL-2069 ensure threshline instantiated to avoid NPE --- diff --git a/src/jalview/gui/FeatureColourChooser.java b/src/jalview/gui/FeatureColourChooser.java index 9a5b3cd..6280a64 100644 --- a/src/jalview/gui/FeatureColourChooser.java +++ b/src/jalview/gui/FeatureColourChooser.java @@ -278,6 +278,9 @@ public class FeatureColourChooser extends JalviewDialog } } + threshline = new GraphLine((max - min) / 2f, "Threshold", Color.black); + threshline.value = cs.getThreshold(); + if (cs.hasThreshold()) { // initialise threshold slider and selector @@ -285,9 +288,6 @@ public class FeatureColourChooser extends JalviewDialog slider.setEnabled(true); slider.setValue((int) (cs.getThreshold() * scaleFactor)); thresholdValue.setEnabled(true); - threshline = new GraphLine((max - min) / 2f, "Threshold", - Color.black); - threshline.value = cs.getThreshold(); } adjusting = false;