fix: pcall-guard C_ClassInfo.GetSpecInfo to silence CoA spec API spam
On the current CoA Beta client, C_ClassInfo.GetAllSpecs(class) returns items that GetSpecInfo cannot accept as arg #2, throwing 'Script::ValidateInput Invalid argument type at index 2. Expected string.' ~150 times per session across DF, LibOpenRaid, gears, profiles, etc. Wrap every unguarded GetSpecInfo(class, spec) site in pcall + nil-guard so the iteration skips bad entries silently. Matches the pattern already used by CoaExporter and prevents Error.txt flooding.
This commit is contained in:
+3
-1
@@ -2705,7 +2705,8 @@ Details.specToTexture = {}
|
||||
for _, class in ipairs(CLASS_SORT_ORDER) do
|
||||
local specs = C_ClassInfo.GetAllSpecs(class)
|
||||
for _, spec in ipairs(specs) do
|
||||
local specInfo = C_ClassInfo.GetSpecInfo(class, spec)
|
||||
local ok, specInfo = pcall(C_ClassInfo.GetSpecInfo, class, spec)
|
||||
if ok and specInfo then
|
||||
local thumbnail
|
||||
if ClassTalentUtil then
|
||||
thumbnail = ClassTalentUtil.GetThumbnailAtlas(class, spec)
|
||||
@@ -2717,6 +2718,7 @@ for _, class in ipairs(CLASS_SORT_ORDER) do
|
||||
Details.textureToSpec[thumbnail] = specInfo.ID
|
||||
Details.specToTexture[specInfo.ID] = thumbnail
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--oldschool talent tree
|
||||
|
||||
Reference in New Issue
Block a user