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
+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