attempt to concatenate field 'unitid' (a nil value)
kulpsin opened this issue ยท 2 comments
Some errors keep popping when I'm in combat. Reason might lie in mobs occasionally having nil target thus targettarget id nil, or something else I don't know.
Message: Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: attempt to concatenate field 'unitid' (a nil value)
Time: Fri Feb 28 14:49:09 2020
Count: 6
Stack: Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: attempt to concatenate field 'unitid' (a nil value)
[C]: ?
Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: in function <Interface\AddOns\NeatPlatesHub\functions\Text.lua:155>
(tail call): ?
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1009: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:996>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:525: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:501>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:646: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:642>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1345: in function `?'
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1258: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1257>
Locals:
Message: Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: attempt to concatenate field 'unitid' (a nil value)
Time: Fri Feb 28 14:49:09 2020
Count: 2
Stack: Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: attempt to concatenate field 'unitid' (a nil value)
(tail call): ?
Interface\AddOns\NeatPlatesHub\functions\Text.lua:157: in function <Interface\AddOns\NeatPlatesHub\functions\Text.lua:155>
(tail call): ?
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1009: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:996>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:525: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:501>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:646: in function <Interface\AddOns\NeatPlates\NeatPlatesCore.lua:642>
Interface\AddOns\NeatPlates\NeatPlatesCore.lua:1796: in function `THREAT_UPDATE'
Interface\AddOns\NeatPlates\NeatPlatesUtility.lua:27: in function <Interface\AddOns\NeatPlates\NeatPlatesUtility.lua:27>
[C]: ?
...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:29: in function <...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:64: in function `Fire'
...BM-Core\Libs\LibThreatClassic2\LibThreatClassic2.lua:806: in function `ThreatUpdatedForUnit'
...BM-Core\Libs\LibThreatClassic2\LibThreatClassic2.lua:787: in function `ThreatUpdated'
...ore\Libs\LibThreatClassic2\ThreatClassModuleCore.lua:1113: in function `AddTargetThreat'
...ore\Libs\LibThreatClassic2\ThreatClassModuleCore.lua:1131: in function `AddThreat'
...ore\Libs\LibThreatClassic2\ThreatClassModuleCore.lua:993: in function `parseGain'
...ore\Libs\LibThreatClassic2\ThreatClassModuleCore.lua:549: in function `handler'
...ore\Libs\LibThreatClassic2\ThreatClassModuleCore.lua:702: in function `?'
...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:119: in function <...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:119>
[C]: ?
...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:29: in function <...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:25>
...ory\Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua:64: in function `Fire'
...AddOns\Bartender4\libs\AceEvent-3.0\AceEvent-3.0.lua:120: in function <...AddOns\Bartender4\libs\AceEvent-3.0\AceEvent-3.0.lua:119>
Locals: <none>
I edited the Text.lua:156 to if unit.reaction ~= "FRIENDLY" and unit.isInCombat and unit.unitid ~= nil then
, and hopefully this will stop errors. I don't know anything about the internals though so this might be bad idea.
The unit.unitid there is actually the unit itself, not it's target. So it's extremely odd that it would have a nameplate but not a unitid for whatever reason.
The change you made is fine, but this issue would probably also affect some other text functions so it should be checked a bit earlier to make sure the unit table is complete with information.
I noticed this error popping up after I selected "Target Of" in Health Bar View -> Enemy Status Text, if I remember correctly. I also did some other changes, but this one seems like possible cause for these errors. That is the reason why I thought targets being nil might be the problem.