# HG changeset patch # User Felix Wolfsteller # Date 1377760493 -7200 # Node ID 765cf5fe26c369a1d2a02ae9a706280326cff3bf # Parent 4c0222d9405532efbc07a465afb039bb614cb548 DischargeCurveGenerator: Prevent NPE when no gauge can be found. No gauge happens e.g. at Rhein Vollmer-curve-calculations with default values. diff -r 4c0222d94055 -r 765cf5fe26c3 artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Wed Aug 28 12:02:56 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DischargeCurveGenerator.java Thu Aug 29 09:14:53 2013 +0200 @@ -82,6 +82,10 @@ // Get gauge which is defined for km Gauge gauge = RiverUtils.getRiver(artifact).determineGauge(km-0.1d, km+0.1d); + if (gauge == null) { + logger.error("No Gauge could be found at station " + km + "!"); + return 0d; + } double subtractPNP = 0d; // Compare to km. if (Math.abs(km - gauge.getStation().doubleValue()) < tolerance) {