JAL-2069 ensure threshline instantiated to avoid NPE
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Nov 2017 11:33:43 +0000 (11:33 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Wed, 8 Nov 2017 11:33:43 +0000 (11:33 +0000)
src/jalview/gui/FeatureColourChooser.java

index 9a5b3cd..6280a64 100644 (file)
@@ -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;