Error with UnitInfoHelpers.lua
Closed this issue · 11 comments
SweepyBoop/Common/UnitInfoHelpers.lua:84: attempt to compare nil with number
[string "@SweepyBoop/Common/UnitInfoHelpers.lua"]:84: in function `UnitIsHostile'
[string "@SweepyBoop/Nameplates/Nameplates.lua"]:51: in function <SweepyBoop/Nameplates/Nameplates.lua:42>
[string "@SweepyBoop/Nameplates/Nameplates.lua"]:131: in function <SweepyBoop/Nameplates/Nameplates.lua:122>
Locals:
unitId = "nameplate2"
possessedFactor = false
(*temporary) = nil
(*temporary) = nil
(*temporary) = "player"
(*temporary) = "attempt to compare nil with number"
Error triggers even in towns from friendly NPCs.
Has been happening since the update from Jan 22.
From further testing, the error pops up when you get the interact icon on an NPC or object.
Do I need to turn on NPC nameplates to see this issue?
Trying to repro it and make a fix
Oh never mind, there is no option "NPC nameplates".
This happens when an icon newly pops on top of a NPC right?
I'll add a null check after calling UnitReaction, I think it can return nil sometimes.
any NPC or any object yes; whether it's a bag icon for a vendor or a loot icon for a chest or a cogwheel for a bench...
Strange, I don't see this issue with the bag icon or loot icon.
UnitReaction shouldn't return nil when something is in range.
Could you check with just this addon enabled?
The interact icon appears a bit before you get in range, when it's still greyed out. That's when the error pops.
I see, if this only happens for NPCs, I think we can treat them as hostile to avoid showing class icons on their head..
(and since they are non players, they won't show spec icon or totem indicators)
Will make a fix that way.
I can confirm it doesn't trigger the error again with the latest version. Thank you!