]> source.dussan.org Git - vaadin-framework.git/commitdiff
Don't return initied UI from LegacyApplication.createUIInstance (#9443)
authorLeif Åstrand <leif@vaadin.com>
Mon, 3 Sep 2012 12:21:39 +0000 (15:21 +0300)
committerLeif Åstrand <leif@vaadin.com>
Mon, 3 Sep 2012 12:23:13 +0000 (15:23 +0300)
server/src/com/vaadin/Application.java

index 2af3c6a59ff329b8ddadeefa8e14442ec4de443b..f368257ecd5878680aa0f2acd754e130d428720b 100644 (file)
@@ -235,6 +235,25 @@ public class Application implements Terminal.ErrorListener, Serializable {
             return mainWindow;
         }
 
+        /**
+         * This implementation simulates the way of finding a window for a
+         * request by extracting a window name from the requested path and
+         * passes that name to {@link #getWindow(String)}.
+         * <p>
+         * {@inheritDoc}
+         */
+        @Override
+        public UI getUIForRequest(WrappedRequest request) {
+            UI uiInstance = getUIInstance(request);
+            if (uiInstance.getUIId() == -1) {
+                // Not initialized -> Let go through createUIInstance to make it
+                // initialized
+                return null;
+            } else {
+                return uiInstance;
+            }
+        }
+
         /**
          * This implementation simulates the way of finding a window for a
          * request by extracting a window name from the requested path and