changeset 6737:1960d55bafb1

issue1393: Avoid NPE for off-epoch when actually no off-epoch data available.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 31 Jul 2013 15:41:57 +0200
parents 60e9494978c4
children be8a5e1911ed
files artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java	Wed Jul 31 15:27:51 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java	Wed Jul 31 15:41:57 2013 +0200
@@ -430,6 +430,10 @@
             results = sqlQuery.list();
 
             SedimentLoad load = new SedimentLoad();
+            if (results.isEmpty()) {
+                log.warn("No results for off-epoch");
+                return new SedimentLoad();
+            }
             Object[] row = results.get(0);
             load = new SedimentLoad(
                     (String) row[0],

http://dive4elements.wald.intevation.org