fix(config): 增加cfg的类型检查避免运行时报错
修改gate.lua和ticketmachine.lua中的版本更新判断逻辑,新增对cfg变量的类型检查,避免当cfg为nil或非table类型时触发访问异常,提升代码健壮性。
This commit is contained in:
@@ -1427,7 +1427,7 @@ while true do
|
||||
pcall(function()
|
||||
refreshRemoteLuaVersion(guessBaseFromStatusURL(serverURL))
|
||||
end)
|
||||
if type(cfg.force_update) == "boolean" and cfg.force_update == true and versionMismatch == true then
|
||||
if type(cfg) == "table" and type(cfg.force_update) == "boolean" and cfg.force_update == true and versionMismatch == true then
|
||||
pendingGateUpdate = true
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user