diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 145:b2c5a66022f1

Exception handling for number conversions in writer modules.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 27 Jun 2011 18:22:21 +0200
parents 8f30f7e802d6
children 2bf35f0babd0
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Jun 27 17:22:52 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Jun 27 18:22:21 2011 +0200
@@ -163,10 +163,19 @@
             }
 
             //The scale.
-            double maxScale =
-                Double.parseDouble(layerElement.getAttribute("max_scale"));
-            double minScale =
-                Double.parseDouble(layerElement.getAttribute("min_scale"));
+            double maxScale = 0;
+            double minScale = 0;
+            try {
+                maxScale =
+                    Double.parseDouble(layerElement.getAttribute("max_scale"));
+                minScale =
+                    Double.parseDouble(layerElement.getAttribute("min_scale"));
+            }
+            catch(NumberFormatException nfe) {
+                logger.warn("Error setting scale.");
+                maxScale = 0;
+                minScale = 0;
+            }
             layer.setMaxscaledenom(maxScale);
             layer.setMinscaledenom(minScale);
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)