AdiBags - Bound

AdiBags - Bound

9.4k Downloads

[BUG] Scanner is nil at line 249 in Main.lua

SpareSimian opened this issue · 4 comments

commented

Description

Looks like a variation of #5, this time with C_TooltipInfo.GetBagItem returning nil. I'll add some logging to see what's going on.

Addon Version

v1.7.1

World of Warcraft Flavor

Retail (Dragonflight)

Tested with only AdiBags_Bound

  • Yes
  • No

Lua Error

Date: 2023-05-12 17:29:23
ID: 1
Error occured in: Global
Count: 14
Message: Interface/AddOns/AdiBags_Bound/Main.lua line 249:
   attempt to index upvalue 'Scanner' (a nil value)
Debug:
   [string "=(tail call)"]: ?
   [string "@Interface/AddOns/AdiBags/core/Filters.lua"]:146: Filter()
   [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:849: FilterSlot()
   [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:883: DispatchItem()
   [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1052: RedispatchAllItems()
   [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:1211:
      Interface/AddOns/AdiBags/widgets/ContainerFrame.lua:1194
   [string "=(tail call)"]: ?
   [string "@Interface/AddOns/AdiBags/widgets/ContainerFrame.lua"]:458: ?()
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:109:
      ...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109
   [string "=[C]"]: ?
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19:
      ...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54: SendMessage()
   [string "@Interface/AddOns/AdiBags/core/Core.lua"]:372: ?()
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:109:
      ...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:109
   [string "=[C]"]: ?
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:19:
      ...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:15
   [string "@Interface/AddOns/AdiBags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua"]:54:
      ...ags/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:49
   [string "=(tail call)"]: ?
Locals:
(*temporary) = <function> defined =[C]:-1

Reproduction Steps

Went to bank in Oribos and hit "D" to dump reagents into the reagent bank. I've seen it before on a different character but didn't have time to file a bug, and I think it was the same conditions.

Screenshots

No response

commented

Starting to think we have some sort of race condition here. It's trying to filter items that are no longer in the bag or should be in the bank but aren't there yet.

I'll try the "D" today, and should likely remove the Scanner thing. It was meant to be reused by my other addons as a tooltip scanner global namespace, but I ended up never implementing TT scanning anywhere else.

commented

I've released v1.7.2 (638540c), hopefully fixing this. Can you give this a spin once it hits the Curse servers please?

commented

I'm using Ajour for downloading addons and pulled it straight from the release on GitHub. (It's very fast, unlike the Curse downloader.)

It looks like you changed the variable name from Scanner to tooltipInfo but the logic is the same.

I'd added this but it hasn't triggered yet:

      Scanner = C_TooltipInfo_GetBagItem(bag, slot)
      if not Scanner then
         print("AdiBags_Bound: C_TooltipInfo_GetBagItem(" .. bag .. ", " .. slot .. ") returned nil!")
         return S_BOE
      end

I'll add the debug print to the new version and see what happens.

commented

Sounds good, I’ll wait for your next comment then! Hopefully it catches the funky business.

Also, you’ll notice I didn’t just rename the variable. I’m now using Scanner exclusively in classic builds as the tooltip frame. Retail now uses its own variable with a narrow closure (just the filter function). My idea was to avoid reusing the same variable reference for multiple items