changeset 3798:90f91ba077a8

Made importer more robust flys-backend/trunk@5461 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Thu, 13 Sep 2012 16:34:02 +0000
parents 0f99e9f1a2ca
children b9a99fcc78c3
files flys-backend/ChangeLog flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java
diffstat 2 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/flys-backend/ChangeLog	Thu Sep 13 10:53:34 2012 +0000
+++ b/flys-backend/ChangeLog	Thu Sep 13 16:34:02 2012 +0000
@@ -1,3 +1,8 @@
+2012-09-12	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
+
+	* src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java:
+	  Made code more robust.
+
 2012-09-12	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/java/de/intevation/flys/importer/Config.java:
--- a/flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java	Thu Sep 13 10:53:34 2012 +0000
+++ b/flys-backend/src/main/java/de/intevation/flys/importer/parsers/BedHeightParser.java	Thu Sep 13 16:34:02 2012 +0000
@@ -328,11 +328,15 @@
         if (m.matches()) {
             String tmp = m.group(1).replace(";", "");
 
-            obj.setType(new ImportBedHeightType(
-                BedHeightType.getBedHeightName(tmp),
-                tmp));
+            String name = BedHeightType.getBedHeightName(tmp);
 
-            return true;
+            if (name != null) {
+                obj.setType(new ImportBedHeightType(name, tmp));
+                return true;
+            }
+            else {
+                log.warn("Unknown bed height type: '" + tmp + "'");
+            }
         }
 
         return false;

http://dive4elements.wald.intevation.org