Administrator
2025-12-13 faa59ad8f374d64b187dc087312c3aef397006ee
fix(okxNewPrice): 修复 WebSocket 推送数据字段缺失问题

- 增加对 'arg' 字段的空值检查
- 增加对 'channel' 字段的空值检查
- 添加缺失字段时的日志警告信息
- 避免因字段缺失导致的潜在运行时异常
1 files modified
12 ■■■■■ changed files
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java 12 ●●●●● patch | view | raw | blame | history
src/main/java/com/xcong/excoin/modules/okxNewPrice/OkxQuantWebSocketClient.java
@@ -289,7 +289,17 @@
    }
    private void subscribeEvent(JSONObject response) {
        String channel = response.getString("channel");
        JSONObject arg = response.getJSONObject("arg");
        if (arg == null) {
            log.warn("无效的推送数据,缺少 'arg' 字段 :{}",response);
            return;
        }
        String channel = arg.getString("channel");
        if (channel == null) {
            log.warn("无效的推送数据,缺少 'channel' 字段{}",response);
            return;
        }
        if (OrderInfoWs.ORDERINFOWS_CHANNEL.equals(channel)) {
            OrderInfoWs.initEvent(response);
        }