From e810fed27a55b9ea888b29658e52329a06698322 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Leif=20=C3=85strand?= Date: Tue, 4 Sep 2012 15:48:07 +0300 Subject: [PATCH] Do detach() before clearing application (#9419) --- server/src/com/vaadin/ui/UI.java | 5 +++-- 1 file 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(); } } -- 2.39.5