frozn / TipTac

WoW AddOn TipTac Reborn
GNU General Public License v3.0
109 stars 23 forks source link

Interface/SharedXML/Color.lua:60: bad argument #2 to 'format' (string expected, got nil) (GeneratePlayerLines) #183

Closed Jeremy7600 closed 1 year ago

Jeremy7600 commented 1 year ago

Describe the bug Bug appears intermittently when navigating the world.

To Reproduce

  1. Walk to Cooking Daily quest giver in Dalaran
  2. Hover over quest giver
  3. See error

Expected behavior No error

TipTac Reborn (please complete the following information):

WoW (please complete the following information):

Additional context Message: Interface/SharedXML/Color.lua:60: bad argument #2 to 'format' (string expected, got nil) Time: Fri Jan 27 11:51:38 2023 Count: 20 Stack: Interface/SharedXML/Color.lua:60: bad argument #2 to 'format' (string expected, got nil)

string "=[C]": in function `format' [string "@Interface/SharedXML/Color.lua"]:60: in function <Interface/SharedXML/Color.lua:59>

[string "@Interface/AddOns/TipTac/ttStyle.lua"]:229: in function GeneratePlayerLines' [string "@Interface/AddOns/TipTac/ttStyle.lua"]:338: in functionModifyUnitTooltip' [string "@Interface/AddOns/TipTac/ttStyle.lua"]:470: in function ?' [string "@Interface/AddOns/TipTac/libs/LibFroznFunctions-1.0/LibFroznFunctions-1.0.lua"]:688: in functionFireGroupEvent' [string "@Interface/AddOns/TipTac/ttCore.lua"]:2238: in function `SetUnitAppearanceToTip' [string "@Interface/AddOns/TipTac/ttCore.lua"]:2319: in function <Interface/AddOns/TipTac/ttCore.lua:2278>

Locals:

Jeremy7600 commented 1 year ago

Does not always happen at this quest giver.

frozn commented 1 year ago

Seems a little strange to me that the error occures in function GeneratePlayerLines() because it's a NPC. I walked to the quest giver and got no error if hovering over this unit.

But in the case UnitRace() doesn't return a valid race, the error you mentioned occures. So I added a check for this case. This will be included in the next release. 👍

Jeremy7600 commented 1 year ago

It is random and maybe a player walked under my cursor. It happened later just walking around Dalaran, I didn't notice who my mouse was on.