[Lada-commits] [PATCH] fixed some nullpointers in messproramm validator rules

Wald Commits scm-commit at wald.intevation.org
Fri Sep 23 16:45:41 CEST 2016


# HG changeset patch
# User Maximilian Krambach <mkrambach at intevation.de>
# Date 1474553697 -7200
# Node ID a7404bf577fd0168715dbafdd9bf0d133ab32c36
# Parent  61b94641cf995b5ad9007e7196a7eb03128ac139
fixed some nullpointers in messproramm validator rules

diff -r 61b94641cf99 -r a7404bf577fd src/main/java/de/intevation/lada/validation/rules/messprogramm/SubIntervall.java
--- a/src/main/java/de/intevation/lada/validation/rules/messprogramm/SubIntervall.java	Thu Sep 08 12:03:43 2016 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messprogramm/SubIntervall.java	Thu Sep 22 16:14:57 2016 +0200
@@ -24,7 +24,9 @@
         Messprogramm messprogramm = (Messprogramm)object;
         Violation violation = new Violation();
 
-        if (messprogramm.getTeilintervallVon()
+        if (messprogramm.getTeilintervallBis() != null
+            && messprogramm.getTeilintervallVon() != null
+            && messprogramm.getTeilintervallVon()
             > messprogramm.getTeilintervallBis()) {
             violation.addError("teilintervallVon", 662);
             violation.addError("teilintervallBis", 662);
diff -r 61b94641cf99 -r a7404bf577fd src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java
--- a/src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java	Thu Sep 08 12:03:43 2016 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java	Thu Sep 22 16:14:57 2016 +0200
@@ -24,7 +24,9 @@
         Messprogramm messprogramm = (Messprogramm)object;
         Violation violation = new Violation();
 
-        if (messprogramm.getGueltigVon() > messprogramm.getGueltigBis()) {
+        if (messprogramm.getGueltigVon() != null
+            && messprogramm.getGueltigBis() != null
+            && messprogramm.getGueltigVon() > messprogramm.getGueltigBis()) {
             violation.addError("gueltigVon", 662);
             violation.addError("gueltigBis", 662);
         }


More information about the Lada-commits mailing list