fix: guard unavailable quest draw thread

This commit is contained in:
Xurkon
2026-06-05 22:19:44 -05:00
parent 94707e1b93
commit b75d624938
2 changed files with 19 additions and 0 deletions
+4
View File
@@ -282,6 +282,10 @@ end
_DrawAvailableQuest = function(questId)
NewThread(function()
local quest = QuestieDB.GetQuest(questId)
if not quest then
Questie:Debug(Questie.DEBUG_LEARNER, "[AvailableQuests] Skipping unavailable quest during draw:", questId)
return
end
if (not quest.tagInfoWasCached) then
QuestieDB.GetQuestTagInfo(questId) -- cache to load in the tooltip
+15
View File
@@ -0,0 +1,15 @@
local function read(path)
local f = assert(io.open(path, "r"), "cannot open " .. path)
local c = f:read("*a")
f:close()
return c
end
describe("Questie available quests guard", function()
it("skips unavailable quests before touching tagInfoWasCached", function()
local content = read("Modules/Quest/AvailableQuests.lua")
assert.is_true(content:find("if not quest then", 1, true) ~= nil)
assert.is_true(content:find("Skipping unavailable quest during draw", 1, true) ~= nil)
assert.is_true(content:find("quest.tagInfoWasCached = true", 1, true) ~= nil)
end)
end)