ImogenBits / tidyplates

Tidy Plates - World of Warcraft Nameplate Addon
11 stars 5 forks source link

Lua Error: Attempt to compare number with nil #118

Open Rrojas93 opened 1 month ago

Rrojas93 commented 1 month ago

I'll get this error in the middle of fights and usual get 4 popups from it:

1/4:

Message: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
Time: Thu Sep 19 21:45:52 2024
Count: 6
Stack: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
[string "=[C]"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:29: in function <Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:27>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:161: in function `SetAlpha'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:747: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:745>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:871: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:820>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:1048: in function `?'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:952: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:951>

Locals: 

2/4:

Message: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
Time: Thu Sep 19 21:45:53 2024
Count: 6
Stack: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
[string "=[C]"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:29: in function <Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:27>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:161: in function `SetAlpha'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:747: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:745>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:890: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:878>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:1063: in function `?'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:952: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:951>

Locals: 

3/4:

Message: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
Time: Thu Sep 19 21:45:57 2024
Count: 12
Stack: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
[string "=[C]"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:29: in function <Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:27>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:161: in function `SetAlpha'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:747: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:745>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:871: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:820>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:1074: in function `?'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:952: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:951>

Locals: 

4/4:

Message: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
Time: Thu Sep 19 21:45:57 2024
Count: 12
Stack: Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:29: attempt to compare number with nil
[string "=[C]"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:29: in function <Interface/AddOns/TidyPlatesHub/functions/Alpha.lua:27>
[string "=(tail call)"]: ?
[string "@Interface/AddOns/TidyPlatesHub/functions/Alpha.lua"]:161: in function `SetAlpha'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:747: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:745>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:890: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:878>
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:1089: in function `?'
[string "@Interface/AddOns/TidyPlates/TidyPlatesCore.lua"]:952: in function <Interface/AddOns/TidyPlates/TidyPlatesCore.lua:951>

Locals: 
mbinkhorst commented 1 month ago

I quickly patched this out while waiting for a proper fix:

Replacing line 29 in TidyPlatesHub/functions/Alpha.lua with:

if unit.threatValue and unit.threatValue > 1 and unit.health and unit.health > 0 then return LocalVars.OpacitySpotlight end