summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-29 13:51:02 +0200
committerTeemu Suo-Anttila <tsuoanttila@users.noreply.github.com>2018-01-31 14:27:32 +0200
commit3b2e6029636984a61e41f413ab3235759dc0eade (patch)
tree0e68b7aa4074ff5c00dbe7b1b75be797aa27ab16
parent8bc470f4404d21a65520d4eae50b434dbe92985a (diff)
downloadvaadin-framework-3b2e6029636984a61e41f413ab3235759dc0eade.tar.gz
vaadin-framework-3b2e6029636984a61e41f413ab3235759dc0eade.zip
Fix removeUI assertions to work with proxy UIs (#10574)
-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);