Questie

Questie

116M Downloads

Questie overwrites WoW's built-in `error` function

jfarmer opened this issue ยท 2 comments

commented

Bug description

The error function is the standard way to throw errors in Lua. WoW offers the same API.

Questie 4.1.1 (and possibly other versions) overwrite this with nil due to an improperly scoped variable named error. Any other AddOn that then tries to use this part of WoW's core API breaks.

See below for a patch file that fixes this.

commented

Here is the patch:

diff --git a/Questie/Modules/QuestieTracker.lua b/Questie/Modules/QuestieTracker.lua
index 93f133a..ad438f5 100755
--- a/Questie/Modules/QuestieTracker.lua
+++ b/Questie/Modules/QuestieTracker.lua
@@ -1243,7 +1243,7 @@ function QuestieTracker:CreateBaseFrame()
 
     if Questie.db.char.TrackerLocation then
         -- we need to pcall this because it can error if something like MoveAnything is used to move the tracker
-        result, error = pcall(frm.SetPoint, frm, unpack(Questie.db.char.TrackerLocation))
+        local result, error = pcall(frm.SetPoint, frm, unpack(Questie.db.char.TrackerLocation))
         if not result then
             Questie.db.char.TrackerLocation = nil
             print(QuestieLocale:GetUIString('TRACKER_INVALID_LOCATION'))
@@ -1254,7 +1254,7 @@ function QuestieTracker:CreateBaseFrame()
             end
         end
     else
-        result, error = pcall(frm.SetPoint, frm, unpack({QuestWatchFrame:GetPoint()}))
+        local result, error = pcall(frm.SetPoint, frm, unpack({QuestWatchFrame:GetPoint()}))
         if not result then
             Questie.db.char.TrackerLocation = nil
             print(QuestieLocale:GetUIString('TRACKER_INVALID_LOCATION'))
commented

Thanks for the report. We've made some major refactorings of our code because of such obvious code flaws. The dev branch has finally been merged and therefore this is fixed on master now. Will be included in the next release!