]> source.dussan.org Git - vaadin-framework.git/commitdiff
Allow changing NavigationStateManager (#9416)
authorapolds <simonapold@gmail.com>
Wed, 24 May 2017 05:34:28 +0000 (07:34 +0200)
committerHenri Sara <henri.sara@gmail.com>
Wed, 24 May 2017 05:34:28 +0000 (08:34 +0300)
Unregister old NavigationStateManager before setting new one (backport of #9410).

Fixes #9406

server/src/main/java/com/vaadin/navigator/Navigator.java

index 15936f61684a42287015b2b36c9559be62d9e9d1..172ab39928fb2a6f290f89a75af81a204da61847 100644 (file)
@@ -513,6 +513,10 @@ public class Navigator implements Serializable {
         if (stateManager == null) {
             stateManager = new UriFragmentManager(ui.getPage());
         }
+        if (stateManager != null && this.stateManager != null
+                && stateManager != this.stateManager) {
+            this.stateManager.setNavigator(null);
+        }
         this.stateManager = stateManager;
         this.stateManager.setNavigator(this);
         this.display = display;