[Dive4elements-commits] [PATCH 1 of 2] Partial fix for issue862: avoid NPE

Wald Commits scm-commit at wald.intevation.org
Wed May 8 10:29:50 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1367934427 -7200
# Node ID 22dbf92a4f181383c58e0f00ce4b395bff14b479
# Parent  c35323148b98312700df6ad1b87274d96615c355
Partial fix for issue862: avoid NPE.

diff -r c35323148b98 -r 22dbf92a4f18 artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightCalculation.java	Wed May 08 09:58:52 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightCalculation.java	Tue May 07 15:47:07 2013 +0200
@@ -147,9 +147,11 @@
         List<BedHeightSingleValue> values =
             BedHeightSingleValue.getBedHeightSingleValues(single, kmLo, kmHi);
 
+        int year = single.getYear() != null ? single.getYear() : 0;
+
         MiddleBedHeightData data = new MiddleBedHeightData(
-            single.getYear(),
-            single.getYear(),
+            year,
+            year,
             single.getEvaluationBy(),
             single.getDescription());
 


More information about the Dive4elements-commits mailing list