[PATCH] Avoid NPE if no dataset is activated in theme list

Wald Commits scm-commit at wald.intevation.org
Fri Sep 26 08:40:35 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1411713620 -7200
# Node ID e87a993c6611eb3208041c2286f442dc9eba9033
# Parent  274d606ea50ee00ff542fadfa8275560cf302a6d
Avoid NPE if no dataset is activated in theme list.

diff -r 274d606ea50e -r e87a993c6611 artifacts/src/main/java/org/dive4elements/river/exports/DischargeGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DischargeGenerator.java	Fri Sep 26 08:36:28 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DischargeGenerator.java	Fri Sep 26 08:40:20 2014 +0200
@@ -48,6 +48,11 @@
             return;
         }
 
+        if (data.getRange() == null) {
+            // No active datasets
+            return;
+        }
+
         Range range = inCm(data.getRange(), pnpValue);
 
         // Do we have an index for W in cm?


More information about the Dive4Elements-commits mailing list