exochron / MountJournalEnhanced

This is an interface addon for World of Warcraft, which extends the ingame mount journal with some cool stuff.
https://www.curseforge.com/wow/addons/mount-journal-enhanced
GNU General Public License v3.0
13 stars 2 forks source link

LUA Error when Collected -> Usable Only filter on in no mount area #43

Closed travisneids closed 3 years ago

travisneids commented 3 years ago

Did some testing on the error below and it seems to be related to having the filter "Collected -> Usable Only" on when in an area mounts are not usable (Maw & some covenant areas).

PR incoming with a possible solution for now until you find a more elegant way if necessary.


Time: Mon Jan 18 09:28:27 2021
Count: 1
Stack: ...AddOns\MountJournalEnhanced\MountJournalEnhanced.lua:50: attempt to index field '?' (a nil value)
[string "=[C]"]: ?
[string "@Interface\AddOns\MountJournalEnhanced\MountJournalEnhanced.lua"]:50: in function <...AddOns\MountJournalEnhanced\MountJournalEnhanced.lua:30>
[string "@Interface\AddOns\MountJournalEnhanced\MountJournalEnhanced.lua"]:80: in function `GetDisplayedMountInfo'
[string "@Interface\AddOns\Blizzard_Collections\Blizzard_MountCollection.lua"]:617: in function `MountJournal_Select'
[string "@Interface\AddOns\Blizzard_Collections\Blizzard_MountCollection.lua"]:363: in function `MountJournal_FullUpdate'
[string "@Interface\AddOns\Blizzard_Collections\Blizzard_MountCollection.lua"]:371: in function <...ns\Blizzard_Collections\Blizzard_MountCollection.lua:370>
[string "=[C]"]: in function `Show'
[string "@Interface\FrameXML\UIParent.lua"]:2910: in function `SetUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2755: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:2623: in function <Interface\FrameXML\UIParent.lua:2619>
[string "=[C]"]: in function `SetAttribute'
[string "@Interface\FrameXML\UIParent.lua"]:3468: in function `ShowUIPanel'
[string "@Interface\FrameXML\UIParent.lua"]:1093: in function `SetCollectionsJournalShown'
[string "@Interface\FrameXML\UIParent.lua"]:1083: in function `ToggleCollectionsJournal'
[string "TOGGLECOLLECTIONSPETJOURNAL"]:1: in function <[string "TOGGLECOLLECTIONSPETJOURNAL"]:1>

Locals: 
exochron commented 3 years ago

Thank you for your report and PR.

I was able to reproduce this bug. It's basically an out of bound error with the indexMap. In your described situation, you would basically have an empty list. But the UI tries to select the first entry (index=1). That results in this error. :(

I'm going to decline your PR though. It needs some more changes to fix this. Don't worry, I got this. :) The fix is going to be in the next version (probably 2.10)

travisneids commented 3 years ago

No problem! Figured you'd have a better solution as I'm pretty fresh to LUA/WoW scripting (thankfully career helps a little! haha)