Fix LSM30:Fetch guards - also check LSM30.Fetch exists before calling

Previous guard only checked LSM30 ~= nil; if Fetch method is absent on
the stub object the call still crashes. Now uses full 3-part check:
  (LSM30 and LSM30.Fetch and LSM30:Fetch(...)) or fallback
Matches the pattern already used in QuestieArrow.lua.
This commit is contained in:
Xurkon
2026-04-24 04:36:25 -05:00
parent a2a325c8ab
commit def947bec1
4 changed files with 7 additions and 7 deletions
+1 -1
View File
@@ -1275,7 +1275,7 @@ function QuestieTracker:Update()
line.label:SetPoint("TOPLEFT", line, "TOPLEFT", lineWidthQBC, 0) line.label:SetPoint("TOPLEFT", line, "TOPLEFT", lineWidthQBC, 0)
-- Set Timer font -- Set Timer font
line.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or Questie.db.profile.trackerFontObjective, line.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective)) or Questie.db.profile.trackerFontObjective,
Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline) Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
-- Set Timer Title based on states -- Set Timer Title based on states
+1 -1
View File
@@ -209,7 +209,7 @@ function TrackerHeaderFrame:Update()
headerFrame.questieIcon:SetPoint("TOPLEFT", headerFrame, "TOPLEFT", 6, 0) headerFrame.questieIcon:SetPoint("TOPLEFT", headerFrame, "TOPLEFT", 6, 0)
headerFrame.questieIcon:Show() headerFrame.questieIcon:Show()
headerFrame.trackedQuests.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontHeader) or Questie.db.profile.trackerFontHeader, trackerFontSizeHeader, Questie.db.profile.trackerFontOutline) headerFrame.trackedQuests.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontHeader)) or Questie.db.profile.trackerFontHeader, trackerFontSizeHeader, Questie.db.profile.trackerFontOutline)
local maxQuestAmount = "/" .. C_QuestLog.GetMaxNumQuestsCanAccept() local maxQuestAmount = "/" .. C_QuestLog.GetMaxNumQuestsCanAccept()
local _, activeQuests = GetNumQuestLogEntries() local _, activeQuests = GetNumQuestLogEntries()
+4 -4
View File
@@ -562,7 +562,7 @@ function TrackerLinePool.Initialize(questFrame)
-- Charges Updates -- Charges Updates
self.count:Hide() self.count:Hide()
self.count:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest) or Questie.db.profile.trackerFontQuest, Questie.db.profile.trackerFontSizeQuest, "OUTLINE") self.count:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest)) or Questie.db.profile.trackerFontQuest, Questie.db.profile.trackerFontSizeQuest, "OUTLINE")
if self.charges > 1 then if self.charges > 1 then
self.count:SetText(self.charges) self.count:SetText(self.charges)
self.count:Show() self.count:Show()
@@ -1089,16 +1089,16 @@ TrackerLinePool.SetMode = function(self, mode)
self.mode = mode self.mode = mode
if mode == "zone" then if mode == "zone" then
local trackerFontSizeZone = Questie.db.profile.trackerFontSizeZone local trackerFontSizeZone = Questie.db.profile.trackerFontSizeZone
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontZone) or Questie.db.profile.trackerFontZone, trackerFontSizeZone, Questie.db.profile.trackerFontOutline) self.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontZone)) or Questie.db.profile.trackerFontZone, trackerFontSizeZone, Questie.db.profile.trackerFontOutline)
self.label:SetHeight(trackerFontSizeZone) self.label:SetHeight(trackerFontSizeZone)
elseif mode == "quest" or mode == "achieve" then elseif mode == "quest" or mode == "achieve" then
local trackerFontSizeQuest = Questie.db.profile.trackerFontSizeQuest local trackerFontSizeQuest = Questie.db.profile.trackerFontSizeQuest
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest) or Questie.db.profile.trackerFontQuest, trackerFontSizeQuest, Questie.db.profile.trackerFontOutline) self.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontQuest)) or Questie.db.profile.trackerFontQuest, trackerFontSizeQuest, Questie.db.profile.trackerFontOutline)
self.label:SetHeight(trackerFontSizeQuest) self.label:SetHeight(trackerFontSizeQuest)
self.button = nil self.button = nil
elseif mode == "objective" then elseif mode == "objective" then
local trackerFontSizeObjective = Questie.db.profile.trackerFontSizeObjective local trackerFontSizeObjective = Questie.db.profile.trackerFontSizeObjective
self.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or Questie.db.profile.trackerFontObjective, trackerFontSizeObjective, Questie.db.profile.trackerFontOutline) self.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective)) or Questie.db.profile.trackerFontObjective, trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
self.label:SetHeight(trackerFontSizeObjective) self.label:SetHeight(trackerFontSizeObjective)
end end
end end
+1 -1
View File
@@ -163,7 +163,7 @@ function TrackerQuestTimers:UpdateTimerFrame()
local timeRemainingString, timeRemaining = TrackerQuestTimers:GetRemainingTimeByQuestId(timer.questId) local timeRemainingString, timeRemaining = TrackerQuestTimers:GetRemainingTimeByQuestId(timer.questId)
if timeRemainingString ~= nil then if timeRemainingString ~= nil then
Questie:Debug(Questie.DEBUG_SPAM, "[TrackerQuestTimers:UpdateTimerFrame] - ", timeRemainingString) Questie:Debug(Questie.DEBUG_SPAM, "[TrackerQuestTimers:UpdateTimerFrame] - ", timeRemainingString)
timer.frame.label:SetFont(LSM30 and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective) or Questie.db.profile.trackerFontObjective, Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline) timer.frame.label:SetFont((LSM30 and LSM30.Fetch and LSM30:Fetch("font", Questie.db.profile.trackerFontObjective)) or Questie.db.profile.trackerFontObjective, Questie.db.profile.trackerFontSizeObjective, Questie.db.profile.trackerFontOutline)
timer.frame.label:SetText(Questie:Colorize(timeRemainingString, "blue")) timer.frame.label:SetText(Questie:Colorize(timeRemainingString, "blue"))
timer.frame:SetWidth(timer.frame.label:GetWidth() + ((34) - (18 - Questie.db.profile.trackerFontSizeQuest)) + Questie.db.profile.trackerFontSizeQuest) timer.frame:SetWidth(timer.frame.label:GetWidth() + ((34) - (18 - Questie.db.profile.trackerFontSizeQuest)) + Questie.db.profile.trackerFontSizeQuest)
else else