]> source.dussan.org Git - vaadin-framework.git/commitdiff
Do detach() before clearing application (#9419)
authorLeif Åstrand <leif@vaadin.com>
Tue, 4 Sep 2012 12:48:07 +0000 (15:48 +0300)
committerLeif Åstrand <leif@vaadin.com>
Tue, 4 Sep 2012 12:48:07 +0000 (15:48 +0300)
server/src/com/vaadin/ui/UI.java

index 4b861d7a252ddfa8b798a091033edbdbe94c79d1..ee4cb9fd2cedcbe958274784ef35c8ff1557fbb8 100644 (file)
@@ -691,13 +691,14 @@ public abstract class UI extends AbstractComponentContainer implements
         if ((application == null) == (this.application == null)) {
             throw new IllegalStateException("Application has already been set");
         } else {
+            if (application == null) {
+                detach();
+            }
             this.application = application;
         }
 
         if (application != null) {
             attach();
-        } else {
-            detach();
         }
     }