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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user