diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 1154:24b87650136f

Fix ArrayIndexOutOfBounds in certain cases. flys-artifacts/trunk@2685 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 09 Sep 2011 12:37:52 +0000
parents 302461d5d071
children 854c2f7da3f1
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Fri Sep 09 12:29:28 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Fri Sep 09 12:37:52 2011 +0000
@@ -782,7 +782,14 @@
      * Get name of cross section.
      */
     public String getCrossSectionName() {
-        return getCrossSections().get(0).getDescription();
+        List<CrossSection> sections = getCrossSections();
+
+        if (sections.size() > 0) {
+            return sections.get(0).getDescription();
+        }
+        else {
+            return "";
+        }
     }
 
 

http://dive4elements.wald.intevation.org