Fix MapIconTooltip _GetLevelString nil level crash

Root cause: creatureLevels entry for 'Uneasy Citizen' was {} (empty table)
instead of {minLevel, maxLevel, rank}, so creatureLevels[name][1] was nil.
Added early-return guard in _GetLevelString: if creatureLevels[name] is
falsy or has no numeric level at index [1], return name unchanged.

Also updated CHANGELOG.md [Unreleased] section with this fix.
This commit is contained in:
Xurkon
2026-05-09 08:23:54 -05:00
parent 5d56944907
commit 01b7f07c41
2 changed files with 4 additions and 1 deletions
+1
View File
@@ -4,6 +4,7 @@
### Bug Fixes
- **[Fix — MapIconTooltip _GetLevelString Guard]** Resolved `attempt to concatenate local 'minLevel' (a nil value)` crash in `MapIconTooltip.lua:494` (`_GetLevelString` function). The creature name "Uneasy Citizen" existed in `creatureLevels` as an empty table `{}` rather than the expected `[1]=minLevel, [2]=maxLevel, [3]=rank` tuple, causing `creatureLevels[name][1]` to return nil. Added an early-return guard at the top of `_GetLevelString`: if `creatureLevels[name]` is falsy or not a table with a numeric level at index `[1]`, return the name unmodified.
- **[Fix — Tooltip NPC/Object Type Guard]** Resolved a crash in `QuestieTooltips` when hovering over NPC or object tooltip keys (`m_<id>`, `o_<id>`) where `learnedNpc[10]` or `learnedObj[10]` was unexpectedly a string instead of a table.
- **Root Cause**: `InsertMissingQuestIds` in the WotLKDB corrections files writes directly to `QuestieDB.questData[questId]` but `questData` is stored as a loadable Lua string on Ascension. When code later tried to index into that string as a table, it threw `attempt to index field 'questData' (a string value)`.
- **Fix**: Added `if type(objList) ~= "table" then break end` guard in both `m_/NPC` and `o_/object` iteration paths in `Tooltip.lua` before iterating `learnedNpc[10]` / `learnedObj[10]`.
+3 -1
View File
@@ -485,6 +485,9 @@ function MapIconTooltip:Show()
end
local function _GetLevelString(creatureLevels, name)
if not creatureLevels[name] then
return name
end
local levelString = name
if creatureLevels[name] then
local minLevel = creatureLevels[name][1]
@@ -510,7 +513,6 @@ function MapIconTooltip:Show()
end
return levelString
end
-- Used to get the white color for the quests which don't have anything to collect
local defaultQuestColor = QuestieLib:GetRGBForObjective({})
local creatureLevels = QuestieDB:GetCreatureLevels(quest) -- Data for min and max level