diff options
author | Teemu Suo-Anttila <tsuoanttila@users.noreply.github.com> | 2018-01-29 13:51:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-29 13:51:14 +0200 |
commit | 723af6a680cc59fb681ea61291391ec802ae7dd0 (patch) | |
tree | ec42d8c4695a676e15f9cc90caf411a1b9a830a4 | |
parent | f1039e892ca4d40e7ed441264f1d35b30733d679 (diff) | |
download | vaadin-framework-723af6a680cc59fb681ea61291391ec802ae7dd0.tar.gz vaadin-framework-723af6a680cc59fb681ea61291391ec802ae7dd0.zip |
Fix removeUI assertions to work with proxy UIs (#10575)
-rw-r--r-- | server/src/main/java/com/vaadin/server/VaadinSession.java | 6 |
1 files 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 8cb833e68f..131f541385 100644 --- a/server/src/main/java/com/vaadin/server/VaadinSession.java +++ b/server/src/main/java/com/vaadin/server/VaadinSession.java @@ -867,8 +867,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); |