changeset 8725:68827654ea7a

(issue1754) Fix check for empty data bounds
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 29 Apr 2015 14:13:57 +0200
parents 47199406994a
children 7f1fb07e4e3d
files artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Wed Apr 29 12:30:57 2015 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/LongitudinalSectionGenerator2.java	Wed Apr 29 14:13:57 2015 +0200
@@ -97,11 +97,13 @@
             if (dataBounds == null) {
                 // Diagram is empty.
                 candidate = new Range(0d, 0d);
+                log.debug("Empty diagram using fake Range");
+            } else {
+                // Diagram is not zoomed
+                candidate = new Range(dataBounds.getLower().doubleValue(),
+                                      dataBounds.getUpper().doubleValue());
+                log.debug("Using Full X Range.");
             }
-            // Diagram is not zoomed
-            candidate = new Range(dataBounds.getLower().doubleValue(),
-                                  dataBounds.getUpper().doubleValue());
-            log.debug("Using Full X Range.");
         }
         log.debug("startkm for Radius is: " + candidate.getLowerBound() +
                   " endkm: " + candidate.getUpperBound());

http://dive4elements.wald.intevation.org