changeset 5290:394841a66c14

MainValuesArtifact: Possible NPE fix.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 14 Mar 2013 12:34:40 +0100
parents f6478773a5bb
children 8aae8c26844f
files flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Thu Mar 14 12:24:29 2013 +0100
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/MainValuesArtifact.java	Thu Mar 14 12:34:40 2013 +0100
@@ -175,14 +175,15 @@
         logger.debug("MainValuesArtifact.initialize");
         FLYSArtifact winfo = (FLYSArtifact) artifact;
         RangeAccess rangeAccess = new RangeAccess(winfo, null);
-        double [] locations = rangeAccess.getLocations();
+        double [] locations = rangeAccess.getKmRange();
+
         if (locations != null) {
             double location = locations[0];
             addData("ld_locations", new DefaultStateData("ld_locations", null, null,
                     String.valueOf(location)));
         }
         else {
-            logger.warn("No location for mainvalues given.");
+            logger.error("No location for mainvalues given.");
         }
         importData(winfo, "river");
     }
@@ -247,7 +248,13 @@
         // TODO use helper to get location as double
         String locationStr = getDataAsString("ld_locations");
 
-        if (river == null || locationStr == null) {
+        if (river == null) {
+            logger.error("River is null");
+            return null;
+        }
+
+        if (locationStr == null) {
+            logger.error("Locationstr is null");
             return null;
         }
 

http://dive4elements.wald.intevation.org