[Dive4elements-commits] [PATCH 2 of 4] WQKmsFactory: prevent NPE

Wald Commits scm-commit at wald.intevation.org
Mon May 13 11:13:57 CEST 2013


# HG changeset patch
# User Felix Wolfsteller <felix.wolfsteller at intevation.de>
# Date 1368436588 -7200
# Node ID bd6d7da9c6fd4ab40a8b60ad87e9cf93e482567b
# Parent  2e57fb04aa6f0d7370422b3812220e66aa7a0d32
WQKmsFactory: prevent NPE.

diff -r 2e57fb04aa6f -r bd6d7da9c6fd artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java	Mon May 13 11:14:13 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/WQKmsFactory.java	Mon May 13 11:16:28 2013 +0200
@@ -147,6 +147,9 @@
         for (int i = 0, N = results.size(); i < N; i++) {
             Object[] row = results.get(i);
             // add(w, q, km)
+            if (row == null || row[0] == null || row[1] == null || row[2] == null) {
+                log.warn("A value in result for WQKms is null.");
+            }
             wqkms.add((Double) row[1], (Double) row[2], (Double) row[0]);
         }
 


More information about the Dive4elements-commits mailing list