[Dive4elements-commits] [PATCH] Fix null pointer exception in ImportMeasurement Station

Wald Commits scm-commit at wald.intevation.org
Wed Mar 27 17:50:10 CET 2013


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1364402986 -3600
# Node ID f9eee1909e6e6ec5bbed3dad7b8ffbefc9777e70
# Parent  b6a6d13eec416164c27f77560dc9ff581a545166
Fix null pointer exception in ImportMeasurement Station

    Range may be null

diff -r b6a6d13eec41 -r f9eee1909e6e flys-backend/src/main/java/de/intevation/flys/importer/ImportMeasurementStation.java
--- a/flys-backend/src/main/java/de/intevation/flys/importer/ImportMeasurementStation.java	Wed Mar 27 16:26:50 2013 +0100
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/ImportMeasurementStation.java	Wed Mar 27 17:49:46 2013 +0100
@@ -64,7 +64,12 @@
                 log.error("Exception: " + e.getMessage());
             }
 
-            Range range = this.range.getPeer(river);
+            Range range = null;
+
+            if (this.range != null) {
+                range = this.range.getPeer(river);
+            }
+
             if (range == null) {
                 log.warn("No range found for measurement station'" + name + "'");
             }


More information about the Dive4elements-commits mailing list