[PATCH] issue1393: Avoid NPE for off-epoch when actually no off-epoch data available
Wald Commits
scm-commit at wald.intevation.org
Wed Jul 31 15:32:09 CEST 2013
# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1375278117 -7200
# Node ID 1960d55bafb1abfee2360179e1d4abbdada54d3f
# Parent 60e9494978c45cdecc413cc589a9c013c27d7ab2
issue1393: Avoid NPE for off-epoch when actually no off-epoch data available.
diff -r 60e9494978c4 -r 1960d55bafb1 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFactory.java
--- 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],
More information about the Dive4elements-commits
mailing list