Skip to content

Commit e46a2a2

Browse files
committed
fix: 修复一些报错问题
1 parent 1dd561f commit e46a2a2

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

MY_Chat/src/MY_AutoHideChat.lua

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,13 @@ end
193193

194194
-- 初始化/生效 设置
195195
function D.Apply()
196-
local shaBack = X.GetChatPanel(1):Lookup('Wnd_Message', 'Shadow_Back')
196+
local hFrame = X.GetChatPanel(1)
197197
local editInput = X.GetChatInput()
198-
if not shaBack or not editInput then
198+
if not hFrame or not editInput then
199+
return
200+
end
201+
local shaBack = hFrame:Lookup('Wnd_Message', 'Shadow_Back')
202+
if not shaBack then
199203
return
200204
end
201205
if O.bEnable then

MY_Chat/src/MY_ChatCopy.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,8 @@ end)
218218

219219
function D.CheckNamelinkEnable()
220220
for _, k in X.pairs_c(X.CONSTANT.CHAT_PANEL_INDEX_LIST) do
221-
local h = X.GetChatPanel(k):Lookup('Wnd_Message', 'Handle_Message')
221+
local hFrame = X.GetChatPanel(k)
222+
local h = hFrame and hFrame:Lookup('Wnd_Message', 'Handle_Message')
222223
if h then
223224
D.CheckNamelinkHook(h, 0)
224225
end

MY_Chat/src/MY_ChatMosaics.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,10 @@ function D.ResetMosaics()
8484
-- re mosaics
8585
D.bForceUpdate = true
8686
for _, k in X.pairs_c(X.CONSTANT.CHAT_PANEL_INDEX_LIST) do
87-
D.Mosaics(X.GetChatPanel(k):Lookup('Wnd_Message', 'Handle_Message'))
87+
local hFrame = X.GetChatPanel(k)
88+
if hFrame then
89+
D.Mosaics(hFrame:Lookup('Wnd_Message', 'Handle_Message'))
90+
end
8891
end
8992
D.bForceUpdate = nil
9093
-- hook chat panel

0 commit comments

Comments
 (0)