From b70545d03a03ce3b6fe80a3c7b7789ad2da53d82 Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 24 Jul 2016 17:24:10 +0200 Subject: [PATCH] targettarget: fix nil color error --- modules/targettarget.lua | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/modules/targettarget.lua b/modules/targettarget.lua index 06dc590d..0303c267 100644 --- a/modules/targettarget.lua +++ b/modules/targettarget.lua @@ -53,10 +53,11 @@ pfUI:RegisterModule("targettarget", function () pfUI.uf.targettarget.hp.bar:SetMinMaxValues(0, UnitHealthMax("targettarget")) - local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5 - - pfUI.uf.targettarget.hp.bar:SetStatusBarColor(r, g, b, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75) - pfUI.uf.targettarget.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1) + if color then + local r, g, b = (color.r + .5) * .5, (color.g + .5) * .5, (color.b + .5) * .5 + pfUI.uf.targettarget.hp.bar:SetStatusBarColor(r, g, b, UnitHealth("targettarget") / UnitHealthMax("targettarget") / 4 + .75) + pfUI.uf.targettarget.hp.text:SetTextColor(r+.3,g+.3,b+.3, 1) + end pfUI.uf.targettarget.hp.text:SetText( UnitName("targettarget")) local display, real