Bad argument to strmatch
I get this whenever I try to use /bis, regardless of whether my search is like "/bis foo" or by just /bis then foo in the search box of the BankItems window.
`2x BankItems/BankItems.lua:3075: bad argument #1 to 'strmatch' (string expected, got nil) [C]: ? [BankItems/BankItems.lua]:3075: in function 'BankItems_ParseLink' [BankItems/BankItems.lua]:3090: in function 'BankItems_ParseAndCorrectLink' [BankItems/BankItems.lua]:6230: in function 'BankItems_Search' [BankItems/BankItems.lua]:3833: in function 'BankItems_SlashHandler' [BankItems/BankItems.lua]:8238: in function '?' [Blizzard_ChatFrameBase/Mainline/ChatFrame.lua]:5517: in function <Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:5463> [C]: in function 'ChatEdit_ParseText' [Blizzard_ChatFrameBase/Mainline/ChatFrame.lua]:5169: in function <Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:5168> [C]: in function 'ChatEdit_SendText' [Blizzard_ChatFrameBase/Mainline/ChatFrame.lua]:5205: in function <Blizzard_ChatFrameBase/Mainline/ChatFrame.lua:5201> [C]: in function 'ChatEdit_OnEnterPressed' [*ChatFrame.xml:140_OnEnterPressed]:1: in function <[string "*ChatFrame.xml:140_OnEnterPressed"]:1>
Locals: (*temporary) = nil (temporary) = "%[(.)%]" (*temporary) = "string expected, got nil" `
Version: 11.0.0.2 (6 Aug 2024)
FWIW, I tried a quick and easy fix of just returning "" at line 3090 if the link was nil, but that still doesn't make /bis search work properly, because of other places that are not prepared to encounter a nil value, like linke 6234 where theBag[bagItem].link is nil but is tried to be used with match().
Okay, the two modifications of putting in this at 3090:
if not link then return "" end
Then replacing 6236 (nee 6235) with this:
lastErrorItemID = link and tonumber(theBag[bagItem].link:match("item:([-%d]+)")) or 0
succeeds in making the errors go away and searching do something useful, though I have not done a rigorous examination of whether that is the best fix.
The problem is with the caged pets in guild banks. The client used to return which pet was in the cage by looking at the game tooltip but not anymore. Blizzard needs to do something about pets in guild banks, it's been a clusterfuck since MoP! My fix is to comment out the caged pet logic at lines 8320 to 8335 the if block which starts with:
if itemLink:find("item:82800:") then --if generic caged pet is given then convert to battlepet link
also replace line 7345 from: if theBag[bagItem] then with: if theBag[bagItem] and theBag[bagItem].link then
Then reload and revisit all guild banks.
PS: The line numbers might not match with my lua file since I modified it from the last version.