changeset 698:dae37cbe4ae2 facets-slt

make getGauges() more robust flys-artifacts/branches/facets-slt@2144 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Fri, 17 Jun 2011 11:08:31 +0000
parents b972eba2ed8a
children 3c70aa595724
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java
diffstat 1 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Fri Jun 17 10:40:54 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/FLYSArtifact.java	Fri Jun 17 11:08:31 2011 +0000
@@ -710,8 +710,16 @@
      * @return the gauges based on the selected kilometer range.
      */
     public List<Gauge> getGauges() {
-        River    river = getRiver();
-        double[] dist  = getDistance();
+
+        River river = getRiver();
+        if (river == null) {
+            return null;
+        }
+
+        double [] dist  = getDistance();
+        if (dist == null) {
+            return null;
+        }
 
         return river.determineGauges(dist[0], dist[1]);
     }

http://dive4elements.wald.intevation.org