[Lada-commits] [PATCH 2 of 3] Fixed deskriptor validation

Wald Commits scm-commit at wald.intevation.org
Fri Jul 10 18:37:35 CEST 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1436545791 -7200
# Node ID cb344bc264d95290098831a5c7876f714d3f60c1
# Parent  d74b5b1190aea9d907ece09d9f2f69544559d3ef
Fixed deskriptor validation.

diff -r d74b5b1190ae -r cb344bc264d9 src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java
--- a/src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java	Fri Jul 10 18:29:27 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/Deskriptor.java	Fri Jul 10 18:29:51 2015 +0200
@@ -25,6 +25,9 @@
     @Override
     public Violation execute(Object object) {
         LProbe probe = (LProbe)object;
+        if (probe.getMediaDesk() == null || probe.getMediaDesk().equals("")) {
+            return null;
+        }
         String[] mediaDesk = probe.getMediaDesk().split(" ");
         if (mediaDesk.length <= 1) {
             Violation violation = new Violation();
diff -r d74b5b1190ae -r cb344bc264d9 src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java
--- a/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Fri Jul 10 18:29:27 2015 +0200
+++ b/src/main/java/de/intevation/lada/validation/rules/probe/DeskriptorToUmwelt.java	Fri Jul 10 18:29:51 2015 +0200
@@ -27,6 +27,9 @@
     @Override
     public Violation execute(Object object) {
         LProbe probe = (LProbe)object;
+        if (probe.getMediaDesk() == null || probe.getMediaDesk().equals("")) {
+            return null;
+        }
         String[] mediaDesk = probe.getMediaDesk().split(" ");
         if (mediaDesk.length <= 1) {
             return null;


More information about the Lada-commits mailing list