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
+12 -9
View File
@@ -91,7 +91,8 @@ do
local cf = ChatEdit_GetActiveWindow()
local channel = cf:GetAttribute("chatType")
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
channel = "GUILD"
elseif channel == "RAID_WARNING" or channel == "RAID_LEADER" or channel == "BATTLEGROUND" or channel == "BATTLEGROUND_LEADER" then
@@ -344,14 +345,16 @@ end
function mod:GUILD_ROSTER_UPDATE(evt)
if not IsInGuild() then return end
wipe( channels.GUILD )
for i = 1, GetNumGuildMembers() do
local name, _, _, level, _, _, _, _, online, _, class = GetGuildRosterInfo(i)
if online then
channels.GUILD[name] = name
end
self:AddPlayer(name, class, level, self.db.profile.saveGuild)
end
end
for i = 1, GetNumGuildMembers() do
local name, _, _, level, _, _, _, _, online, _, class = GetGuildRosterInfo(i)
if name then
if online then
channels.GUILD[name] = name
end
self:AddPlayer(name, class, level, self.db.profile.saveGuild)
end
end
end
function mod:RAID_ROSTER_UPDATE(evt)
wipe(channels.RAID)