aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-29 13:51:14 +0200
committerGitHub <noreply@github.com>2018-01-29 13:51:14 +0200
commit723af6a680cc59fb681ea61291391ec802ae7dd0 (patch)
treeec42d8c4695a676e15f9cc90caf411a1b9a830a4
parentf1039e892ca4d40e7ed441264f1d35b30733d679 (diff)
downloadvaadin-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.java6
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);