[Lada-commits] [PATCH] Respect in validation rule that Messzeitpunkt might be null

Wald Commits scm-commit at wald.intevation.org
Mon Mar 20 15:17:39 CET 2017


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1490019440 -3600
# Branch release-2.5
# Node ID 2c4a20e0bc92252285b39440de5647f3f157a702
# Parent  2b4cd062f6a1b4ef3dbbe61074dedf0361183123
Respect in validation rule that Messzeitpunkt might be null.

diff -r 2b4cd062f6a1 -r 2c4a20e0bc92 src/main/java/de/intevation/lada/validation/rules/messung/Date.java
--- a/src/main/java/de/intevation/lada/validation/rules/messung/Date.java	Wed Mar 15 10:01:24 2017 +0100
+++ b/src/main/java/de/intevation/lada/validation/rules/messung/Date.java	Mon Mar 20 15:17:20 2017 +0100
@@ -46,11 +46,13 @@
             Map<String, Integer> errors = new HashMap<String, Integer>();
             errors.put("lprobe", 604);
         }
-        if (probe.getProbeentnahmeEnde() == null ||
-            probe.getProbeentnahmeEnde().after(messung.getMesszeitpunkt())) {
-            Violation violation = new Violation();
-            violation.addWarning("messzeitpunkt", 632);
-            return violation;
+        if (messung.getMesszeitpunkt() != null) {
+            if (probe.getProbeentnahmeEnde() == null ||
+                probe.getProbeentnahmeEnde().after(messung.getMesszeitpunkt())) {
+                Violation violation = new Violation();
+                violation.addWarning("messzeitpunkt", 632);
+                return violation;
+            }
         }
         return null;
     }


More information about the Lada-commits mailing list