changeset 5920:22dbf92a4f18

Partial fix for issue862: avoid NPE.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 07 May 2013 15:47:07 +0200 (2013-05-07)
parents c35323148b98
children 17b07104d093
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/MiddleBedHeightCalculation.java
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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());
 

http://dive4elements.wald.intevation.org