From 01b7f07c415dec7bb324ec5495b58b83bd1b1827 Mon Sep 17 00:00:00 2001 From: Xurkon Date: Sat, 9 May 2026 08:23:54 -0500 Subject: [PATCH] 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. --- CHANGELOG.md | 1 + Modules/Tooltips/MapIconTooltip.lua | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1298ec0..f09efee 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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_`, `o_`) 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]`. diff --git a/Modules/Tooltips/MapIconTooltip.lua b/Modules/Tooltips/MapIconTooltip.lua index 41b9a33..ba1de52 100644 --- a/Modules/Tooltips/MapIconTooltip.lua +++ b/Modules/Tooltips/MapIconTooltip.lua @@ -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