From 60bcf2bf248349a67b4fcf5ee67faccfaead14df Mon Sep 17 00:00:00 2001 From: root Date: Tue, 12 Aug 2025 19:04:37 +0800 Subject: [PATCH] 1 --- app/core/websocket/adapter.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/core/websocket/adapter.py b/app/core/websocket/adapter.py index bd6416e..c526ec7 100644 --- a/app/core/websocket/adapter.py +++ b/app/core/websocket/adapter.py @@ -90,7 +90,10 @@ class WebSocketAdapter: if msg: # 将消息数据序列化为JSON字符串 import json - if isinstance(msg.data, dict): + if msg.data is None: + # 如果data为None,跳过发送 + logger.debug(f"适配器跳过空数据消息: {self.outbound_channel.name} -> {msg.type}") + elif isinstance(msg.data, dict): # 在发送时添加type字段 send_data = { "Type": msg.type,