fix: guard GetNumClasses in cooldown-table path with CLASS_SORT_ORDER fallback

This commit is contained in:
Florian Andrew George Berthold 2026-06-10 02:15:23 +02:00
parent b459963a29
commit 1b23a9179f

View file

@ -20068,10 +20068,18 @@ function LeaPlusLC:SlashFunc(str)
-- Create class tables (dynamic: covers DEATHKNIGHT and CoA custom classes)
local classList = {}
if GetNumClasses then
for i = 1, GetNumClasses() do
local _, classFile = GetClassInfo(i)
if classFile then tinsert(classList, classFile) end
end
elseif CLASS_SORT_ORDER then
-- CoA: GetNumClasses/GetClassInfo are FrameXML additions that may
-- be absent; fall back to the stock class token list
for i = 1, #CLASS_SORT_ORDER do
tinsert(classList, CLASS_SORT_ORDER[i])
end
end
for index = 1, #classList do
if LeaPlusDB["Cooldowns"][classList[index]] == nil then
LeaPlusDB["Cooldowns"][classList[index]] = {}