[Dive4elements-commits] [PATCH] Avoid NPE

Wald Commits scm-commit at wald.intevation.org
Mon Apr 15 11:46:10 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1366019628 -7200
# Node ID 56897ceb5589f6467b9777b3923720851f472e09
# Parent  4ed36858fe0f409752e48084246f4d3edc9afff4
Avoid NPE.

diff -r 4ed36858fe0f -r 56897ceb5589 flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/SedimentLoadYearSelect.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/SedimentLoadYearSelect.java	Mon Apr 15 11:17:50 2013 +0200
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/states/minfo/SedimentLoadYearSelect.java	Mon Apr 15 11:53:48 2013 +0200
@@ -39,7 +39,7 @@
         SedimentLoadAccess access = new SedimentLoadAccess((FLYSArtifact) artifact, null);
 
         // Second year should be later than first.
-        if (access.getPeriod()[1] < access.getPeriod()[0])
+        if (access.getPeriod() != null && access.getPeriod()[1] < access.getPeriod()[0])
            throw new IllegalArgumentException("error_years_wrong");
 
         return true;


More information about the Dive4elements-commits mailing list