SLOKnightfall / BetterWardrobe

31 stars 15 forks source link

Error when loading xmog interface #485

Open zaphon opened 3 weeks ago

zaphon commented 3 weeks ago

As I've been going through my characters today, I ran into the following issue.

6x ...rfaceBetterWardrobe/Modules/SavedOutfits.lua:278: attempt to concatenate field 'name' (a nil value)
[string "@BetterWardrobe/Modules/SavedOutfits.lua"]:278: in function <...rfaceBetterWardrobe/Modules/SavedOutfits.lua:247>
[string "=[C]"]: in function `securecallfunction'
[string "@Blizzard_Menu/Menu.lua"]:2417: in function `PopulateDescription'
[string "@Blizzard_Menu/DropdownButton.lua"]:252: in function <Blizzard_Menu/DropdownButton.lua:251>
[string "=[C]"]: in function `securecallfunction'
[string "@Blizzard_Menu/DropdownButton.lua"]:262: in function `GenerateMenu'
[string "@Blizzard_Menu/DropdownButton.lua"]:118: in function `OpenMenu'
[string "@Blizzard_Menu/DropdownButton.lua"]:145: in function `SetMenuOpen'
[string "@Blizzard_Menu/DropdownButton.lua"]:105: in function <Blizzard_Menu/DropdownButton.lua:100>

Looking into this, it's because this set that's being loaded doesn't contain a "name". So I had to make a slight modification up in Data\Database.lua in GetOutfits() in the Extended Sets logic. Specifically I changed this.

data.name = addon.OutfitDB.char.outfits[i].name or ""

I added the or "" so that if for some reason it doesn't have a name, it's at least blank. This let me see an empty set and delete it. Once I did that, the error went away for that character and I haven't seen it pop up for another character (yet, I have 300+ characters, who knows what awaits me).

zaphon commented 3 weeks ago

Got another random error (my wife did).

Line 7659 in Modules\Wardroble.lua

local _, sourceID = strsplit(":", addedLink);

I think something was missed here, as addedLink doesn't exist anywhere.