From 3b2e6029636984a61e41f413ab3235759dc0eade Mon Sep 17 00:00:00 2001 From: Teemu Suo-Anttila Date: Mon, 29 Jan 2018 13:51:02 +0200 Subject: [PATCH] Fix removeUI assertions to work with proxy UIs (#10574) --- server/src/main/java/com/vaadin/server/VaadinSession.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/src/main/java/com/vaadin/server/VaadinSession.java b/server/src/main/java/com/vaadin/server/VaadinSession.java index 6bf3a41bd7..a96d09cab6 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -890,8 +890,10 @@ public class VaadinSession implements HttpSessionBindingListener, Serializable { * the UI to remove */ public void removeUI(UI ui) { - assert hasLock(); - assert UI.getCurrent() == ui; + assert hasLock() : "Session is locked"; + assert UI.getCurrent() != null : "Current UI cannot be null"; + assert ui != null : "Removed UI cannot be null"; + assert UI.getCurrent().getUIId() == ui.getUIId() : "UIs don't match"; Integer id = Integer.valueOf(ui.getUIId()); ui.setSession(null); uIs.remove(id); -- 2.39.5