From 253cf0df28b19765e1a2b637baa9a05d7b6f59e2 Mon Sep 17 00:00:00 2001 From: shagu Date: Wed, 19 Jul 2017 10:29:13 +0200 Subject: [PATCH] debuffs: only refresh existing targets --- modules/debuffs.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/modules/debuffs.lua b/modules/debuffs.lua index adc6de55..8872750d 100644 --- a/modules/debuffs.lua +++ b/modules/debuffs.lua @@ -154,8 +154,10 @@ pfUI:RegisterModule("debuffs", function () pfUI.debuffs.objects[unit][unitlevel][effect].start = pfUI.debuffs.objects[unit][unitlevel][effect].old.start pfUI.debuffs.objects[unit][unitlevel][effect].duration = pfUI.debuffs.objects[unit][unitlevel][effect].old.duration pfUI.debuffs.objects[unit][unitlevel][effect].old = {} - --message("reverted old effect: " .. effect .. " on " .. unit .. " (".. unitlevel .. ") from " .. new .. " to " .. saved) - pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + + if pfUI.uf.target then + pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + end end end end @@ -188,7 +190,9 @@ pfUI:RegisterModule("debuffs", function () pfUI.debuffs.lastUnit = unit pfUI.debuffs.lastLevel = unitlevel - pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + if pfUI.uf.target then + pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + end end function pfUI.debuffs:AddEffect(unit, unitlevel, effect) @@ -203,7 +207,9 @@ pfUI:RegisterModule("debuffs", function () pfUI.debuffs.objects[unit][unitlevel][effect].start = GetTime() pfUI.debuffs.objects[unit][unitlevel][effect].duration = L["debuffs"][effect] or 0 - pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + if pfUI.uf.target then + pfUI.uf:RefreshUnit(pfUI.uf.target, "aura") + end end