]> source.dussan.org Git - vaadin-framework.git/commitdiff
#6150 tuning. Avoid npe caused by fix. Most likely a bug in components can cause...
authorMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 16 Dec 2010 09:04:04 +0000 (09:04 +0000)
committerMatti Tahvonen <matti.tahvonen@itmill.com>
Thu, 16 Dec 2010 09:04:04 +0000 (09:04 +0000)
svn changeset:16526/svn branch:6.5

src/com/vaadin/terminal/gwt/client/ApplicationConnection.java

index a1255bd2b981f640de00771af942ee82060d7679..0807c1371da9a19452834cde55b42f3c0ab74181 100755 (executable)
@@ -1104,9 +1104,20 @@ public class ApplicationConnection {
 
     private void purgeUnregistryBag() {
         for (String id : unregistryBag) {
+            ComponentDetail componentDetail = idToPaintableDetail.get(id);
+            if (componentDetail == null) {
+                /*
+                 * this should never happen, but it does :-( See e.g.
+                 * com.vaadin.tests.components.accordion.RemoveTabs (with test
+                 * script)
+                 */
+                VConsole.error("ApplicationConnetion tried to unregister component (id="
+                        + id
+                        + ") that is never registered (or already unregistered)");
+                return;
+            }
             // check if can be cleaned
-            Widget component = (Widget) idToPaintableDetail.get(id)
-                    .getComponent();
+            Widget component = (Widget) componentDetail.getComponent();
             if (!component.isAttached()) {
                 // clean reference from ac to paintable
                 idToPaintableDetail.remove(id);