diff --git a/Assets/ManagedResources/~Lua/Modules/Chat/ChatPanel.lua b/Assets/ManagedResources/~Lua/Modules/Chat/ChatPanel.lua index 8163a95dd8..0c49160af9 100644 --- a/Assets/ManagedResources/~Lua/Modules/Chat/ChatPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Chat/ChatPanel.lua @@ -436,12 +436,18 @@ end -- 聊天节点数据匹配 function this.ChatItemAdapter(node, data, isShowTime) local right = Util.GetGameObject(node, "rightchat") + if not right then + return + end local left = Util.GetGameObject(node, "leftchat") local isMyChat = data.senderId == PlayerManager.uid - right:SetActive(isMyChat) - left:SetActive(not isMyChat) + if right then + right:SetActive(isMyChat) + end + if left then + left:SetActive(not isMyChat) + end node = isMyChat and right or left - local time = Util.GetGameObject(node, "time") local timeLab = Util.GetGameObject(node, "time/Text"):GetComponent("Text") local content = Util.GetGameObject(node, "contentroot/bg/content"):GetComponent("Text")