From b8fb96caffa663ff3c3ea391aedc591aaa8acbe3 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 8 Nov 2017 11:33:43 +0000 Subject: [PATCH] JAL-2069 ensure threshline instantiated to avoid NPE --- src/jalview/gui/FeatureColourChooser.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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; -- 1.7.10.2