SweepyBoop's PvP Helper

SweepyBoop's PvP Helper

468k Downloads

Error with UnitInfoHelpers.lua

Closed this issue · 11 comments

commented

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.

commented

From further testing, the error pops up when you get the interact icon on an NPC or object.

commented

Do I need to turn on NPC nameplates to see this issue?
Trying to repro it and make a fix

commented

Oh never mind, there is no option "NPC nameplates".
This happens when an icon newly pops on top of a NPC right?

commented

I'll add a null check after calling UnitReaction, I think it can return nil sometimes.

commented

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...

commented

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?

commented

The interact icon appears a bit before you get in range, when it's still greyed out. That's when the error pops.

commented

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.

commented

Could you try the update just released?

commented

I can confirm it doesn't trigger the error again with the latest version. Thank you!

commented

Thanks for confirming!
Closing this issue now.