[Dive4elements-commits] [PATCH] Circumvent NPE in Curve. issue flys/1019

Wald Commits scm-commit at wald.intevation.org
Fri Nov 2 11:02:20 CET 2012


# HG changeset patch
# User Sascha L. Teichmann <teichmann at intevation.de>
# Date 1351850535 -3600
# Node ID e0add97c432b19faf311b41c6f75ef5ea1593f46
# Parent  daf0919df76daf165b393f9264d4731e20561dd4
Circumvent NPE in Curve. issue flys/1019

diff -r daf0919df76d -r e0add97c432b flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/extreme/Curve.java
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/extreme/Curve.java	Thu Nov 01 15:16:01 2012 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/model/extreme/Curve.java	Fri Nov 02 11:02:15 2012 +0100
@@ -82,7 +82,7 @@
     /** Calculate value at given x. */
     @Override
     public double value(double x) {
-        if (x < qs[0]) return Double.NaN;
+        if (qs == null || x < qs[0]) return Double.NaN;
         return (x <= qs[qs.length-1]
             ? getSpline()
             : getExtrapolation()).value(x);


More information about the Dive4elements-commits mailing list