Skip to content

Commit cf0a7fc

Browse files
vaadin-bottepi
andauthored
fix: add try-catch to removing UIs (#22200) (#22323) (#22330)
Co-authored-by: Teppo Kurki <teppo.kurki@vaadin.com>
1 parent 26a1852 commit cf0a7fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

flow-server/src/main/java/com/vaadin/flow/component/internal/UIInternals.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,12 @@ public void setSession(VaadinSession session) {
457457
+ ".");
458458
} else {
459459
if (session == null) {
460-
ui.getElement().getNode().setParent(null);
460+
try {
461+
ui.getElement().getNode().setParent(null);
462+
} catch (IllegalStateException e) {
463+
getLogger().warn("Error detaching closed UI {} ",
464+
ui.getUIId(), e);
465+
}
461466
// Disable push when the UI is detached. Otherwise the
462467
// push connection and possibly VaadinSession will live on.
463468
ui.getPushConfiguration().setPushMode(PushMode.DISABLED);

0 commit comments

Comments
 (0)