aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLeif Åstrand <leif@vaadin.com>2012-09-05 11:38:05 +0300
committerLeif Åstrand <leif@vaadin.com>2012-09-05 11:38:05 +0300
commit65240f403416efc82fb5ff9efce682291d426e89 (patch)
tree21abd082aa331bc1c424418933a74196d7d78d11
parentaf0e1bb09fd13401e3a188eaedd5b01c6db7bf78 (diff)
downloadvaadin-framework-65240f403416efc82fb5ff9efce682291d426e89.tar.gz
vaadin-framework-65240f403416efc82fb5ff9efce682291d426e89.zip
Use main window as current UI if not already set #9443
-rw-r--r--server/src/com/vaadin/Application.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java
index e4e49391bb..9498534b4a 100644
--- a/server/src/com/vaadin/Application.java
+++ b/server/src/com/vaadin/Application.java
@@ -185,6 +185,11 @@ public class Application implements Terminal.ErrorListener, Serializable {
throw new IllegalStateException(
"mainWindow is attached to another application");
}
+ if (UI.getCurrent() == null) {
+ // Assume setting a main window from Application.init if there's
+ // no current UI -> set the main window as the current UI
+ UI.setCurrent(mainWindow);
+ }
this.mainWindow = mainWindow;
}