coa.2: guard CoA data shapes (custom classes, comm-seeded records, ungeared chars)
release / release (push) Successful in 5s

Fixes login/UI crashes on Vol'jin - CoA Beta:
- DataStore_Inventory: GetAverageItemLevel returns 0 not nil (Altoholic sort
  + AccountSummary iLvl format); guard login AIL broadcast and 0/0 average.
- DataStore_Pets: GetNumPets returns 0 for unscanned companion table instead
  of assert-crashing TabCharacters.
- DataStore_Characters: GetColoredCharacterName tolerates nil name.
- Altoholic/Characters.lua: GetLineType returns nil for stale line id.

Stamp -coa.2 + X-Edited-By: Exiles on touched addons; README CoA changelog.
This commit is contained in:
2026-05-28 22:16:44 +02:00
parent 95fe53bd89
commit 961290d9bd
9 changed files with 29 additions and 12 deletions
+3 -3
View File
@@ -88,7 +88,7 @@ local function GetAIL(alts)
local out = {}
local character = DataStore:GetCharacter() -- this character
local ail = DataStore:GetAverageItemLevel(character)
local ail = DataStore:GetAverageItemLevel(character) or 0 -- CoA: guard nil so the login AIL broadcast can't crash (mirrors the alt loop below)
table.insert(out, format("%s:%d", UnitName("player"), ail))
if strlen(alts) > 0 then
@@ -162,7 +162,7 @@ function ScanInventory()
end
end
addon.ThisCharacter.averageItemLvl = totalItemLevel / itemCount
addon.ThisCharacter.averageItemLvl = (itemCount > 0) and (totalItemLevel / itemCount) or 0 -- CoA: ungeared char => itemCount 0; avoid 0/0 nan
addon.ThisCharacter.lastUpdate = time()
end
@@ -202,7 +202,7 @@ local function _GetInventoryItemCount(character, searchedID)
end
local function _GetAverageItemLevel(character)
return character.averageItemLvl
return character.averageItemLvl or 0 -- CoA: chars known only via guild comm / not yet scanned have no iLvl; callers do arithmetic on it (Altoholic sort, AccountSummary format)
end
local sentRequests -- recently sent requests