LibItemCache-2.0

LibItemCache-2.0

936 Downloads

Stopped restoring BattlePet items after 2.0

pollyzoid opened this issue ยท 0 comments

commented

Noticed it after a Bagnon plugin (Bagnon_Garbage) stopped highlighting caged pets in my bag completely.
Lib:GetItemInfo gets called with the location of the pet, GetContainerItemInfo finds valid info, passes it to Lib:RestoreItemData and gets garbage (nil) out.
Replacing the first line of Lib:RestoreItemData with:

print("b", item.link, item.id)
local link, id, quality, icon = self:RestoreLinkData(item.link or item.id)
print("a", link, id)

shows that link and id are both nil when given a valid BattlePet link.

I didn't have time to dig much deeper, so I just fixed it by replacing item.link = link with item.link = item.link or link. Not submitting a PR because I don't know if Lib:RestoreLinkData returning nil is by design or a bug.