[Bug]: Lua Error in ItemLevel.lua
mstavchansky opened this issue ยท 3 comments
Addon Version
AdiBags-v1.9.46.zip
World of Warcraft Version
Retail
Describe the bug
I am getting LUA errors since 10.0.0 launch but have updated each time available. Currently attempted on v1.9.46, the following two errors appear when first opening bags, i am sure it is a n item or manual filter conflict maybe?
Message: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
Time: Sat Oct 29 20:21:09 2022
Count: 52
Stack: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:169: in function `UpdateButton_Retail'
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:131: in function `?'
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `SendMessage'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:338: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:626: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:581: in function <Interface/AddOns/AdiBags/widgets/ItemButton.lua:574>
[string "=[C]"]: in function `Show'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1034: in function `PrepareSections'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1155: in function `FullUpdate'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:599: in function <Interface/AddOns/AdiBags/widgets/ContainerFrame.lua:585>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/core/Utility.lua"]:100: in function <Interface/AddOns/AdiBags/core/Utility.lua:92>
[string "@Interface/AddOns/AdiBags/widgets/LayeredRegion.lua"]:119: in function <Interface/AddOns/AdiBags/widgets/LayeredRegion.lua:108>
Locals: <none>
and this error"
Message: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
Time: Sat Oct 29 20:21:09 2022
Count: 52
Stack: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:169: in function `UpdateButton_Retail'
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:131: in function `?'
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `SendMessage'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:338: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:305: in function `FullUpdate'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:270: in function <Interface/AddOns/AdiBags/widgets/ItemButton.lua:258>
[string "=[C]"]: in function `Show'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1034: in function `PrepareSections'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1155: in function `FullUpdate'
[string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:599: in function <Interface/AddOns/AdiBags/widgets/ContainerFrame.lua:585>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/core/Utility.lua"]:100: in function <Interface/AddOns/AdiBags/core/Utility.lua:92>
[string "@Interface/AddOns/AdiBags/widgets/LayeredRegion.lua"]:119: in function <Interface/AddOns/AdiBags/widgets/LayeredRegion.lua:108>
Locals: <none>
Steps to reproduce
Open bag, and two additional errors pop-up each time. It happens at first open, using the 'B' key bind to open all bags or the bag icon on the UI, then again after each time the bag is open. I am not experiencing any issues after the bugs pop in bag functionality.
Message: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
Time: Sat Oct 29 20:29:05 2022
Count: 104
Stack: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:169: in function `UpdateButton_Retail'
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:131: in function `?'
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `SendMessage'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:338: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:626: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:581: in function <Interface/AddOns/AdiBags/widgets/ItemButton.lua:574>
[string "=[C]"]: in function `Show'
[string "@Interface/AddOns/AdiBags/core/Bags.lua"]:89: in function `Open'
[string "@Interface/AddOns/AdiBags/core/Hooks.lua"]:112: in function <Interface/AddOns/AdiBags/core/Hooks.lua:109>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "OPENALLBAGS"]:1: in function <[string "OPENALLBAGS"]:1>
Locals:
in addition to this:
Message: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
Time: Sat Oct 29 20:29:05 2022
Count: 104
Stack: Interface/AddOns/AdiBags/modules/ItemLevel.lua:169: attempt to call field '?' (a nil value)
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:169: in function `UpdateButton_Retail'
[string "@Interface/AddOns/AdiBags/modules/ItemLevel.lua"]:131: in function `?'
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:119: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:119>
[string "=[C]"]: ?
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:29: in function <...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:25>
[string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:64: in function `SendMessage'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:338: in function `Update'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:305: in function `FullUpdate'
[string "@Interface/AddOns/AdiBags/widgets/ItemButton.lua"]:270: in function <Interface/AddOns/AdiBags/widgets/ItemButton.lua:258>
[string "=[C]"]: in function `Show'
[string "@Interface/AddOns/AdiBags/core/Bags.lua"]:89: in function `Open'
[string "@Interface/AddOns/AdiBags/core/Hooks.lua"]:112: in function <Interface/AddOns/AdiBags/core/Hooks.lua:109>
[string "=(tail call)"]: ?
[string "=(tail call)"]: ?
[string "OPENALLBAGS"]:1: in function <[string "OPENALLBAGS"]:1>
Locals: <none>
Verification
- I have disabled all other addons and made sure this bug is triggered only with AdiBags enabled
This bit of code has always somewhat bothered me as unsafe in nature. I'll go ahead and fix/guard against this error. This should be fixed in the next release.
Do you mean code for the addon that existed? It was just never adjusted over the life of the addon?
Yes, that's right. Lua is really, really bad for "safe" programming, and requires the author to take great care in ensuring errors don't show up. This is why addons break so much, and in the worst possible way, at seemingly random times.
This bit of code is particularly unsafe in general (a blind call into a hash map where neither the key, or the existence of the key is checked). I'll refactor it before the next release :)