changeset 8527:76a2268942c6

(issue1794) Safeguard against layers without extent. Just create a broken layer but don't create a syntax error in a mapfile. The syntax error pulls down the whole user wms while this just creates one broken layer.
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 17 Feb 2015 12:36:13 +0100
parents 9e66aa006b42
children f7d1a7e66b12
files artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Fri Jan 30 15:21:35 2015 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Tue Feb 17 12:36:13 2015 +0100
@@ -301,7 +301,13 @@
 
 
     protected void appendMapInformation(Element parent, ElementCreator c) {
-        String mE = GeometryUtils.jtsBoundsToOLBounds(this.maxExtent);
+        String mE;
+        if (this.maxExtent != null) {
+            mE = GeometryUtils.jtsBoundsToOLBounds(this.maxExtent);
+        } else {
+            log.error("Layer without extent. Probably no geometry at all.");
+            mE = "0 0 0 0";
+        }
 
         Element maxExtent = c.create("maxExtent");
         maxExtent.setTextContent(mE);

http://dive4elements.wald.intevation.org