changeset 6016:d24d29d9efa7

issue1320: Handle exception.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 14 May 2013 07:53:51 +0200
parents e514cab94026
children bcaf66443b93
files artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java
diffstat 1 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java	Mon May 13 18:33:01 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WaterlevelSelectState.java	Tue May 14 07:53:51 2013 +0200
@@ -144,12 +144,14 @@
         int idx = -1;
         try {
             idx = Integer.parseInt(parts[2]);
-        }
-        catch (NumberFormatException nfe) { /* do nothing */ }
+            String name = wqkms[idx].getName();
 
-        String name = wqkms[idx].getName();
-
-        return new String[] { StringUtil.wWrap(name) };
+            return new String[] { StringUtil.wWrap(name) };
+        }
+        catch (NumberFormatException nfe) { /* do nothing */
+            logger.error("Cannot get label for " + value + " (" + parts[2] + ")");
+            return new String[] {""};
+        }
     }
 
 

http://dive4elements.wald.intevation.org