# HG changeset patch # User Felix Wolfsteller # 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],