- fixed potential NPE (#4448)
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 28 Apr 2015 14:19:41 +0000 (14:19 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 28 Apr 2015 14:19:41 +0000 (14:19 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/section/description/StatisticalMeasurementValueElement.java

index 601867f8683e2742c0780ca6de2dcc78fa65580d..f29eb5bceec92fb112b5d9d524a345a9d4d70158 100644 (file)
@@ -75,7 +75,13 @@ public class StatisticalMeasurementValueElement extends
        @Override
        public void handleEvent(Object eventSource) {
                if(eventSource == number_value){
-                       getEntity().setValue(number_value.getFloat());
+                       Float floatNumber = number_value.getFloat();
+                       if(floatNumber==null){
+                           String zero = "0.0";
+                floatNumber = new Float(zero);
+                           number_value.setText(zero);
+                       }
+            getEntity().setValue(floatNumber);
                }
                else if(eventSource == combo_type){
                        getEntity().setType(combo_type.getSelection());