I was getting an error while playing an alt that had no equipment sets at all.

This alteration seems to have fixed it:

Code:

local function OnTooltipShow(self)
if (GetNumEquipmentSets() > 0) then
self:SetEquipmentSet(LDB.text)
end
end

The problem is actually that LDB.text is nil; calling :SetEquipmentSet with a string that doesn't match any equipment set's name silently fails without triggering an error, but calling it with a nil value does trigger an error. The same problem also causes the Broker's text and icon to be invisible for characters who don't have any equipment sets yet. The solution is to set the text/icon to UNKNOWN outside of the GetNumEquipmentSets() loop in UpdateDisplay(). The following change solves both problems:

I was getting an error while playing an alt that had no equipment sets at all.

This alteration seems to have fixed it:

Code:

local function OnTooltipShow(self)
if (GetNumEquipmentSets() > 0) then
self:SetEquipmentSet(LDB.text)
end
end

Is GetNumEquipmentSets() an expensive call that would make this inefficient?

Actually, while I'm asking questions, where exactly is self:SetEquipmentSet defined? I did a search for "SetEquipmentSet" in my entire addons directory and searched the addon API and didn't see it anywhere.

I was getting an error while playing an alt that had no equipment sets at all.

This alteration seems to have fixed it:

Code:

local function OnTooltipShow(self)
if (GetNumEquipmentSets() > 0) then
self:SetEquipmentSet(LDB.text)
end
end

Is GetNumEquipmentSets() an expensive call that would make this inefficient?

Actually, while I'm asking questions, where exactly is self:SetEquipmentSet defined? I did a search for "SetEquipmentSet" in my entire addons directory and searched the addon API and didn't see it anywhere.

Tested with Broker_EquipSwitch *no such result. Only yours BE seems to work so odd. Also, I was uncertain about when bugs appears  it mostly happens ON PLAYER_ENTERING_WORLD (also noticed it on equipping some items that doesn't complete an equipment set) and can be cured only by ReloadUI.

Support AddOn Development!

You have just downloaded by the author . If you like this AddOn why not consider supporting the author? This author has set up a donation account. Donations ensure that authors can continue to develop useful tools for everyone.