From be6cc9c317cbf093d84cbe97ddf3933c0d1b79af Mon Sep 17 00:00:00 2001 From: amy Date: Mon, 25 Nov 2024 17:45:05 +0330 Subject: [PATCH] something something prevent npe --- src/main/java/dev/exhq/Main.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } });