something something prevent npe

This commit is contained in:
amy 2024-11-25 17:45:05 +03:30
parent 5c0beb61c7
commit be6cc9c317
No known key found for this signature in database

View file

@ -38,7 +38,8 @@ public class Main {
wsConnectContext.send("connected"); wsConnectContext.send("connected");
}); });
ws.onClose(wsCloseContext -> { 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); client.set(null);
} }
}); });