summaryrefslogtreecommitdiffstats
path: root/server/src/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/com/vaadin')
-rw-r--r--server/src/com/vaadin/ui/UI.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index 4b861d7a25..ee4cb9fd2c 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -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();
}
}