@@ -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(); | |||
} | |||
} | |||