From d2732b9b4da18c3a78a85f122922eff1868c4cba Mon Sep 17 00:00:00 2001 From: Xurkon Date: Sun, 29 Mar 2026 04:25:55 -0500 Subject: [PATCH] Fix: prevent crash when quest name is nil in PrintDifficultyColor --- CHANGELOG.md | 2 ++ Modules/Libs/QuestieLib.lua | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b04f4f4..ce02c5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ ### Ascension Custom Zone Support +- **[Fix — PrintDifficultyColor Nil Text]** Fixed crash in `PrintDifficultyColor` when quest name is nil. Added defensive nil check in `GetColoredQuestName` to return early if `QuestieDB.QueryQuestSingle` returns nil for a quest, preventing "attempt to concatenate local 'text' (a nil value)" errors. + - **[Fix — Custom Zone Map Pins]** Fixed map icons not appearing in Ascension custom zones (e.g., Valley of Trials, Northshire Valley). The issue was that custom zone UiMapData was not properly injected into `QuestieCompat.UiMapData` before HBD initialized its map cache. Added `ApplyCustomZones()` function in `ZoneDB` that hooks `ZoneDB.Initialize` to inject custom zones BEFORE the original initialization runs, ensuring HBD's `mapData` table contains custom zone entries like 1244 (Valley of Trials). - **[Fix — Zone Name Fallback]** Fixed "Unknown Zone" display for custom zones in the tracker. When `GetZoneNameByID` fails for custom zone IDs, the system now falls back to `GetQuestLogZoneName` which reads the zone header directly from the quest log where custom zone names are properly displayed. diff --git a/Modules/Libs/QuestieLib.lua b/Modules/Libs/QuestieLib.lua index ad09a83..5fc0cbe 100644 --- a/Modules/Libs/QuestieLib.lua +++ b/Modules/Libs/QuestieLib.lua @@ -179,6 +179,10 @@ function QuestieLib:GetColoredQuestName(questId, showLevel, showState, blizzLike local name = QuestieDB.QueryQuestSingle(questId, "name") local level, _ = QuestieLib.GetTbcLevel(questId); + if name == nil then + return nil + end + if showLevel then name = QuestieLib:GetQuestString(questId, name, level, blizzLike) end