p3lim-wow / ExtraQuestButton

An extra button for quest items!
Other
14 stars 1 forks source link

C_QuestLog.GetDistanceSqToQuest() sometimes returns nil #28

Closed Pingumania closed 3 years ago

Pingumania commented 3 years ago
ExtraQuestButton\Utils.lua:61: bad argument #1 to 'sqrt' (number expected, got nil)

I am not 100% sure but I think this happens when there is a quest that has no indicator on the world map. Happened on this quest: https://www.wowhead.com/quest=31004/preserved-in-amber

Stanzilla commented 3 years ago

Yup, same here

19x ExtraQuestButton\Utils.lua:61: bad argument #1 to 'sqrt' (number expected, got nil)
[string "=[C]"]: ?
[string "@ExtraQuestButton\Utils.lua"]:61: in function <ExtraQuestButton\Utils.lua:20>
[string "@ExtraQuestButton\Utils.lua"]:115: in function `GetClosestQuestItem'
[string "@ExtraQuestButton\ExtraQuestButton-90000.19-Release.lua"]:142: in function `callback'
[string "@ExtraQuestButton\mixins\EventHandlerMixin.lua"]:56: in function <ExtraQuestButton\mixins\EventHandlerMixin.lua:53>

Locals:
(*temporary) = nil
(*temporary) = "number expected, got nil"
p3lim commented 3 years ago

@Stanzilla which quest? It's an easy fix, I'm just curious.

Stanzilla commented 3 years ago

@p3lim https://www.wowhead.com/quest=55602/what-will-it-lure I think

p3lim commented 3 years ago

Fixed with https://github.com/p3lim-wow/ExtraQuestButton/commit/4a836ae56f6c52703b3fecff8c674f220db5f470.