fix: nil-guard GetChannelName, GetGuildRosterInfo, InterfaceOptions* on CoA client

PlayerNames.lua:94 - GetChannelName can return nil on the CoA-Beta client
when the active channel target is not joined; capture into a local and
fall back to empty string instead of chaining :lower() on nil.

PlayerNames.lua:344 - GetGuildRosterInfo(i) returns nil name/class on
this client (same family as the AltNames.lua fix in 1c4a7e8). Skip the
iteration when name is nil to avoid indexing channels.GUILD[nil] and
passing nil into AddPlayer.

Chatter.lua:204 OpenConfig and Chatter.lua:21 inline func - the Blizzard
InterfaceOptionsFrame globals are absent on CoA-Beta, so calling
IsResizable() or InterfaceOptionsFrame_OpenToCategory() throws. Guard
both call sites and fall back to opening the standalone AceConfigDialog
window.

ChatScroll.lua:53 - InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling
is also missing on this client; only hook it when the global exists,
otherwise AceHook errors out at OnInitialize.
This commit is contained in:
2026-05-24 17:38:31 +02:00
parent 1c4a7e8d5f
commit 7462acab8c
3 changed files with 35 additions and 21 deletions
+9
View File
@@ -19,9 +19,14 @@ local options = {
name = L["Standalone Config"], name = L["Standalone Config"],
desc = L["Open a standalone config window. You might consider installing |cffffff00BetterBlizzOptions|r to make the Blizzard UI options panel resizable."], desc = L["Open a standalone config window. You might consider installing |cffffff00BetterBlizzOptions|r to make the Blizzard UI options panel resizable."],
func = function() func = function()
if InterfaceOptionsFrame and InterfaceOptionsFrame_OpenToCategory then
InterfaceOptionsFrame:Hide() InterfaceOptionsFrame:Hide()
AceConfigDialog:SetDefaultSize("Chatter", 500, 550) AceConfigDialog:SetDefaultSize("Chatter", 500, 550)
AceConfigDialog:Open("Chatter") AceConfigDialog:Open("Chatter")
else
AceConfigDialog:SetDefaultSize("Chatter", 500, 550)
AceConfigDialog:Open("Chatter")
end
end end
} }
} }
@@ -202,6 +207,7 @@ function Chatter:FCF_OpenTemporaryWindow(chatType, chatTarget, sourceChatFrame,
end end
function Chatter:OpenConfig(input) function Chatter:OpenConfig(input)
if InterfaceOptionsFrame and InterfaceOptionsFrame_OpenToCategory then
if input == "config" or not InterfaceOptionsFrame:IsResizable() then if input == "config" or not InterfaceOptionsFrame:IsResizable() then
options.args.defaultArgs.guiHidden = true options.args.defaultArgs.guiHidden = true
InterfaceOptionsFrame:Hide() InterfaceOptionsFrame:Hide()
@@ -212,6 +218,9 @@ function Chatter:OpenConfig(input)
options.args.defaultArgs.guiHidden = false options.args.defaultArgs.guiHidden = false
InterfaceOptionsFrame_OpenToCategory(optFrame) InterfaceOptionsFrame_OpenToCategory(optFrame)
end end
else
LibStub("AceConfigDialog-3.0"):Open("Chatter")
end
end end
do do
+2
View File
@@ -50,7 +50,9 @@ local options = {
function mod:OnInitialize() function mod:OnInitialize()
self.db = Chatter.db:RegisterNamespace(self:GetName(), defaults) self.db = Chatter.db:RegisterNamespace(self:GetName(), defaults)
self:RegisterEvent("CVAR_UPDATE", "ChangedVars") self:RegisterEvent("CVAR_UPDATE", "ChangedVars")
if _G.InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling then
self:RawHook("InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling",true) self:RawHook("InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling",true)
end
end end
function mod:InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling() function mod:InterfaceOptionsSocialPanelChatMouseScroll_SetScrolling()
+4 -1
View File
@@ -91,7 +91,8 @@ do
local cf = ChatEdit_GetActiveWindow() local cf = ChatEdit_GetActiveWindow()
local channel = cf:GetAttribute("chatType") local channel = cf:GetAttribute("chatType")
if channel == "CHANNEL" then if channel == "CHANNEL" then
channel = select(2, GetChannelName(cf:GetAttribute("channelTarget"))):lower() local cn = select(2, GetChannelName(cf:GetAttribute("channelTarget")))
channel = cn and cn:lower() or ""
elseif channel == "OFFICER" then elseif channel == "OFFICER" then
channel = "GUILD" channel = "GUILD"
elseif channel == "RAID_WARNING" or channel == "RAID_LEADER" or channel == "BATTLEGROUND" or channel == "BATTLEGROUND_LEADER" then elseif channel == "RAID_WARNING" or channel == "RAID_LEADER" or channel == "BATTLEGROUND" or channel == "BATTLEGROUND_LEADER" then
@@ -346,11 +347,13 @@ function mod:GUILD_ROSTER_UPDATE(evt)
wipe( channels.GUILD ) wipe( channels.GUILD )
for i = 1, GetNumGuildMembers() do for i = 1, GetNumGuildMembers() do
local name, _, _, level, _, _, _, _, online, _, class = GetGuildRosterInfo(i) local name, _, _, level, _, _, _, _, online, _, class = GetGuildRosterInfo(i)
if name then
if online then if online then
channels.GUILD[name] = name channels.GUILD[name] = name
end end
self:AddPlayer(name, class, level, self.db.profile.saveGuild) self:AddPlayer(name, class, level, self.db.profile.saveGuild)
end end
end
end end
function mod:RAID_ROSTER_UPDATE(evt) function mod:RAID_ROSTER_UPDATE(evt)