diff --git a/src/main/java/dev/exhq/Main.java b/src/main/java/dev/exhq/Main.java index 6ea3c57..3695d2c 100644 --- a/src/main/java/dev/exhq/Main.java +++ b/src/main/java/dev/exhq/Main.java @@ -38,7 +38,8 @@ public class Main { wsConnectContext.send("connected"); }); ws.onClose(wsCloseContext -> { - if (client.get() != null && client.get().session.equals(wsCloseContext.session)) { + var c = client.get(); + if (c != null && c.session.equals(wsCloseContext.session)) { client.set(null); } });