- fixed potential NPE
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 5 May 2015 08:18:41 +0000 (08:18 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 5 May 2015 08:18:41 +0000 (08:18 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/element/NumberWithLabelElement.java

index 57fade3d9416c81b3dc0ac9d1918352cee360288..4b425cf5e9c3d384aa425b94592dfd3716bc7253 100644 (file)
@@ -61,12 +61,14 @@ public class NumberWithLabelElement extends TextWithLabelElement {
         * @return the Integer value or null if {@link NumberFormatException} occurs.
         */
        public Integer getInteger() {
-               String text = super.getText().trim();
-               try {
-                   return text.equals("") ? 0 : new Integer(text);
-        } catch (NumberFormatException e) {
-            exception = e;
-        }
+           if(super.getText()!=null){
+               String text = super.getText().trim();
+               try {
+                   return text.equals("") ? 0 : new Integer(text);
+               } catch (NumberFormatException e) {
+                   exception = e;
+               }
+           }
                return null;
        }