diff options
author | Leif Åstrand <leif@vaadin.com> | 2012-09-05 11:38:05 +0300 |
---|---|---|
committer | Leif Åstrand <leif@vaadin.com> | 2012-09-05 11:38:05 +0300 |
commit | 65240f403416efc82fb5ff9efce682291d426e89 (patch) | |
tree | 21abd082aa331bc1c424418933a74196d7d78d11 | |
parent | af0e1bb09fd13401e3a188eaedd5b01c6db7bf78 (diff) | |
download | vaadin-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.java | 5 |
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; } |