From d5fc3f594c7bf3409a0729ffba97167aa8178d86 Mon Sep 17 00:00:00 2001
From: Helius <wangdoubleone@gmail.com>
Date: Fri, 26 Nov 2021 17:56:25 +0800
Subject: [PATCH] fix

---
 src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java b/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
index 87165a6..2d242e5 100644
--- a/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
+++ b/src/main/java/com/xcong/excoin/websocket/handler/FishHitWebSocketHandler.java
@@ -110,9 +110,12 @@
 
     @Override
     public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
+        log.info("离开websocket");
         Long memberId = SID_MID.get(session.getId());
 
+        if (memberId != null) {
+            MEMBER_SESSIONS.remove(memberId);
+        }
         SID_MID.remove(session.getId());
-        MEMBER_SESSIONS.remove(memberId);
     }
 }

--
Gitblit v1.9.1