changeset 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 62ad0a753b68
children 854c2f7da3f1
files flys-artifacts/ChangeLog flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/ChangeLog	Fri Sep 09 12:29:28 2011 +0000
+++ b/flys-artifacts/ChangeLog	Fri Sep 09 12:37:52 2011 +0000
@@ -1,3 +1,8 @@
+2011-09-09  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java:
+	  Made one case of cross section fetching more robust.
+
 2011-09-09  Felix Wolfsteller <felix.wolfsteller@intevation.de>
 
 	Fix Facet name and Legend of W-Differences, also insert state to specify
--- 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