View Single Post
08/29/21, 04:39 AM   #2
Baertram
Super Moderator
 
Baertram's Avatar
WoWInterface Super Mod
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 4,989
Line 112 is an end?
Please update the error message to your current github code lines so one sees where exactly it errors!

btw PLEASE do not use the constant values like 0 for the actor category BUT use the given constants!
They might change and your code should always use constants like BAG_BAGPACK instead of 1 and GAMEPLAY_ACTOR_CATEGORY_* instead of 0 or 1!
That's why constants were created :-)

Edit:
If the line here is the errror: if name == '' then

You check for name == string but name will be nil in that case you have described.
So you need to add a nil check like this:

if not name or name == '' then

or more simple
name = GetOutfitName(GAMEPLAY_ACTOR_CATGORY_PLAYER, i) or ''
the or '' will react and add an empty string if GetOutfitName returns nil

or just another notation
name = GetOutfitName(GAMEPLAY_ACTOR_CATGORY_PLAYER, i)
if not name then name = '' end

or

name = name or '' --the same as above

Last edited by Baertram : 08/29/21 at 04:43 AM.
  Reply With Quote