changeset 1499:0372797fc9cf

Avoid NPE in StyleEditorWindow. flys-client/trunk@3612 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Fri, 06 Jan 2012 11:53:14 +0000
parents ed16f28e9063
children 2a8b5dcbe8ca
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Fri Jan 06 11:07:32 2012 +0000
+++ b/flys-client/ChangeLog	Fri Jan 06 11:53:14 2012 +0000
@@ -1,3 +1,8 @@
+2012-01-06  Felix Wolfsteller <felix.wolfsteller@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java:
+	  Survive if no style for given Facet exists, notify user.
+
 2012-01-06  Ingo Weinzierl <ingo@intevation.de>
 
 	flys/issue196 (i18n/l10n: Zahlenformate einheitlich)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Fri Jan 06 11:07:32 2012 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/StyleEditorWindow.java	Fri Jan 06 11:53:14 2012 +0000
@@ -6,6 +6,8 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
+import com.smartgwt.client.util.SC;
+
 import com.smartgwt.client.widgets.Window;
 import com.smartgwt.client.widgets.layout.VLayout;
 import com.smartgwt.client.widgets.layout.HLayout;
@@ -169,6 +171,11 @@
         form.setFields(name);
         properties.addMember(form);
 
+        if (style == null) {
+            SC.warn("No style for " + theme.getFacet() + " found.");
+            return properties;
+        }
+
         // Done via array to keep the order.
         String[] sets = {"showlines",
                          "showpoints",

http://dive4elements.wald.intevation.org