Constant Lua Errors when mousing over bag slots.
mnejing opened this issue ยท 3 comments
Addon Version
v0.3.38
World of Warcraft Version
Classic Era (And SoD/Hardcore)
Describe the bug
19x BetterBags/frames/era/item.lua:300: attempt to index global 'context' (a nil value)
[BetterBags/frames/era/item.lua]:300: in function <BetterBags/frames/era/item.lua:298>
[BetterBags/frames/era/item.lua]:315: in function <BetterBags/frames/era/item.lua:314>
[C]: ?
[C]: ?
Locals:
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = nil
(*temporary) = "attempt to index global 'context' (a nil value)"
decoration = nil
themes =
modules =
}
defaultModuleLibraries =
}
name = "BetterBags_Themes"
orderedModules =
}
itemButtons =
}
defaultModuleState = true
windows =
}
baseName = "BetterBags"
themes =
}
enabledState = true
titles =
}
tabs =
}
moduleName = "Themes"
sectionFonts =
}
}
i =
freeSlotName = ""
slotkey = "1_10"
data =
}
ilvlText = FontString {
}
kind = 0
button = BetterBagsItemButton658 {
}
frame = Button {
}
freeSlotCount = 0
}
Steps to reproduce
Mouse over an item in your bag?
I'll check this shortly -- I haven't been testing classic very well in the latest releases.
Fixed in 7bd2ead
Root Cause
The recent taint fix in commit ce29b5f added code that references context:New('itemButton_init') to avoid creating contexts during mouse events. However, while the retail version of frames/item.lua had the Context module imported, the Classic Era version frames/era/item.lua was missing this import, causing the error when mousing over items.
Solution
Added the missing Context module import to frames/era/item.lua:
---@class Context: AceModule
local context = addon:GetModule('Context')This brings the Era version in line with the retail version and resolves the nil reference error.