summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-29 13:51:02 +0200
committerGitHub <noreply@github.com>2018-01-29 13:51:02 +0200
commitfbf5565e30615897124f4c68119bc7cb0a370d8b (patch)
treec5da0c462ed11084e7805bc457bd37c570aeb207 /server
parent2f6f2970bc8ea8bb7d4745b9e87255874ef9fb5e (diff)
downloadvaadin-framework-fbf5565e30615897124f4c68119bc7cb0a370d8b.tar.gz
vaadin-framework-fbf5565e30615897124f4c68119bc7cb0a370d8b.zip
Fix removeUI assertions to work with proxy UIs (#10574)
Diffstat (limited to 'server')
-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 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);