changeset 1053:a7404bf577fd

fixed some nullpointers in messproramm validator rules
author Maximilian Krambach <mkrambach@intevation.de>
date Thu, 22 Sep 2016 16:14:57 +0200
parents 61b94641cf99
children 3c9616e5439f
files src/main/java/de/intevation/lada/validation/rules/messprogramm/SubIntervall.java src/main/java/de/intevation/lada/validation/rules/messprogramm/ValidFromTo.java
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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);
         }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)