Cidan / BetterBags

A total replacement AddOn for World of Warcraft bag frames, inspired by AdiBags.
MIT License
57 stars 24 forks source link

search needs nil protection #361

Open zeptognome opened 3 weeks ago

zeptognome commented 3 weeks ago

Addon Version

v0.1.42

World of Warcraft Version

Retail

Describe the bug

5x BetterBags/frames/item.lua:103: attempt to index local 'data' (a nil value) [string "@BetterBags/frames/item.lua"]:103: in function <BetterBags/frames/item.lua:101> [string "@BetterBags/frames/item.lua"]:163: in function UpdateSearch' [string "@BetterBags/frames/bag.lua"]:198: in functionSearch' [string "@BetterBags/frames/search.lua"]:62: in function `UpdateSearch' [string "@BetterBags/frames/search.lua"]:150: in function <BetterBags/frames/search.lua:149>

Locals: filter = "c" data = nil

Steps to reproduce

v0.1.42 on retail with section view after opening a researcher under fire reward that contained a 'cache' that I opened while there was text in the search bar - all stacking options off. bags 90% full

zeptognome commented 3 weeks ago

function itemFrame.itemProto:UpdateSearch(text) if self.slotkey == nil then return end local data = items:GetItemDataFromSlotKey(self.slotkey) if not data then print("Nil data for: ", self.slotkey, " Type: ", type(self.slotkey)) end if not text or text == "" then self.button:SetMatchesSearch(true) return end

image