Browse Source

1.Soekct文字消息增加判空

master
wangwanlei 10 months ago
parent
commit
948e1da88f

+ 5
- 1
websocket/src/main/java/com/xhly/websocket/service/SocketClient.java View File

13
 import com.neovisionaries.ws.client.WebSocketFrame;
13
 import com.neovisionaries.ws.client.WebSocketFrame;
14
 import com.xhly.corelib.utils.NetworkUtils;
14
 import com.xhly.corelib.utils.NetworkUtils;
15
 
15
 
16
+import org.w3c.dom.Text;
17
+
16
 import java.io.IOException;
18
 import java.io.IOException;
17
 import java.util.List;
19
 import java.util.List;
18
 import java.util.Map;
20
 import java.util.Map;
364
         public void onTextMessage(WebSocket websocket, String text) throws Exception {
366
         public void onTextMessage(WebSocket websocket, String text) throws Exception {
365
             super.onTextMessage(websocket, text);
367
             super.onTextMessage(websocket, text);
366
             hasReceiveHeart();
368
             hasReceiveHeart();
367
-            processTextMessage(text);
369
+            if (!TextUtils.isEmpty(text)){
370
+                processTextMessage(text);
371
+            }
368
         }
372
         }
369
     }
373
     }
370
 }
374
 }

Loading…
Cancel
Save