changeset 8282:b5bef15c982e

Avoid NPE in discharge context injector if no start km was set.
author Raimund Renkert <rrenkert@intevation.de>
date Wed, 17 Sep 2014 09:03:39 +0200
parents da7e623cf159
children dfdd006da30b
files artifacts/src/main/java/org/dive4elements/river/exports/injector/DischargeInjector.java
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/injector/DischargeInjector.java	Wed Sep 17 09:02:44 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/injector/DischargeInjector.java	Wed Sep 17 09:03:39 2014 +0200
@@ -27,6 +27,9 @@
     @Override
     public void injectContext(CallContext ctx, Artifact artifact, Document doc) {
         RangeAccess access = new RangeAccess((D4EArtifact)artifact);
+        if (!access.hasFrom()) {
+            return;
+        }
         double km = access.getFrom();
         Gauge gauge = access.getRiver().determineGaugeByStation(
             km - GAUGE_EPSILON, km + GAUGE_EPSILON);

http://dive4elements.wald.intevation.org