]> source.dussan.org Git - vaadin-framework.git/commitdiff
Fixed #2564 - NPE in ICustomLayout and added a sensible error message if this happens...
authorArtur Signell <artur.signell@itmill.com>
Mon, 9 Feb 2009 19:27:06 +0000 (19:27 +0000)
committerArtur Signell <artur.signell@itmill.com>
Mon, 9 Feb 2009 19:27:06 +0000 (19:27 +0000)
svn changeset:6772/svn branch:trunk

src/com/itmill/toolkit/terminal/gwt/client/ApplicationConnection.java
src/com/itmill/toolkit/terminal/gwt/client/ui/ICustomLayout.java

index ca195e73849156e1247286a166d8b06cf4453da4..cb3fe85951c24551bd5d5c02486e3728c1d622fd 100755 (executable)
@@ -812,6 +812,11 @@ public class ApplicationConnection {
     }-*/;
 
     public void unregisterPaintable(Paintable p) {
+        if (p == null) {
+            ApplicationConnection.getConsole().error(
+                    "WARN: Trying to unregister null paintable");
+            return;
+        }
         String id = getPid(p);
         idToPaintableDetail.remove(id);
         if (p instanceof HasWidgets) {
index 6918a5cbfc2df1ac2515f968675921f0d16642f5..452621dbc15abaeda023419ec9555b49359031eb 100644 (file)
@@ -116,7 +116,10 @@ public class ICustomLayout extends ComplexPanel implements Paintable,
         if (previous == widget) {
             return;
         }
-        remove(previous);
+
+        if (previous != null) {
+            remove(previous);
+        }
 
         // if template is missing add element in order
         if (!hasTemplate()) {