feigndeath: fix nil table index

This commit is contained in:
shagu
2018-04-08 19:46:21 +02:00
parent 69407f8a81
commit 66b270c3b3
+2 -2
View File
@@ -11,10 +11,10 @@ pfUI:RegisterModule("feigndeath", function ()
if event == "PLAYER_TARGET_CHANGED" and UnitIsDead("target") then
healthscan:SetUnit("target")
cache[UnitName("target")] = healthbar:GetValue()
elseif event == "UNIT_HEALTH" and UnitIsDead(arg1) then
elseif event == "UNIT_HEALTH" and UnitIsDead(arg1) and UnitName(arg1) then
healthscan:SetUnit(arg1)
cache[UnitName(arg1)] = healthbar:GetValue()
elseif event == "UNIT_HEALTH" then
elseif event == "UNIT_HEALTH" and UnitName(arg1) then
cache[UnitName(arg1)] = nil
end
end)