[PATCH 18 of 45] (issue1754) Gracefully handle empty differenc results (e.g from km 0, 001 to 0, 002)
Wald Commits
scm-commit at wald.intevation.org
Tue Mar 10 17:05:46 CET 2015
# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1424096859 -3600
# Node ID 0011508d2f9d25aa0a2655ddd460e2ff95cbdf2b
# Parent 04367906f1584d184593f8c112d6a65baec330c0
(issue1754) Gracefully handle empty differenc results (e.g from km 0,001 to 0,002)
diff -r 04367906f158 -r 0011508d2f9d artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFacet.java Mon Feb 16 12:55:38 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/DifferenceCurveFacet.java Mon Feb 16 15:27:39 2015 +0100
@@ -14,6 +14,7 @@
import org.dive4elements.artifacts.Artifact;
import org.dive4elements.artifacts.CallContext;
import org.dive4elements.river.artifacts.WINFOArtifact;
+import org.dive4elements.river.artifacts.model.WKmsImpl;
import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
@@ -54,11 +55,15 @@
WKms [] wkms = (WKms [])res.getData();
- WKms result = wkms[index];
- log.debug("Got difference curve data (" + result.getName()
- + ") at index: " + index);
-
- return result;
+ if (wkms.length > 0) {
+ WKms result = wkms[index];
+ log.debug("Got difference curve data (" + result.getName()
+ + ") at index: " + index);
+ return result;
+ } else {
+ log.debug("Empty difference facet.");
+ return new WKmsImpl();
+ }
}
More information about the Dive4Elements-commits
mailing list