changeset 1316:2c4a20e0bc92 release-2.5

Respect in validation rule that Messzeitpunkt might be null.
author Tom Gottfried <tom@intevation.de>
date Mon, 20 Mar 2017 15:17:20 +0100
parents 2b4cd062f6a1
children 3ac30d816c9a
files src/main/java/de/intevation/lada/validation/rules/messung/Date.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)