From d80004c113121ef488cc887748a5f85f6da3178f Mon Sep 17 00:00:00 2001 From: shagu Date: Sun, 17 Mar 2019 17:22:51 +0100 Subject: [PATCH] unitframes: fix error on invalid reaction colors --- api/unitframes.lua | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index 2c2f0b44..39c54bc6 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1450,10 +1450,8 @@ function pfUI.uf:RefreshUnit(unit, component) local r, g, b, a = .2, .2, .2, 1 if UnitIsPlayer(unitstr) then local _, class = UnitClass(unitstr) - if RAID_CLASS_COLORS[class] then - local color = RAID_CLASS_COLORS[class] - r, g, b = color.r, color.g, color.b - end + local color = RAID_CLASS_COLORS[class] + if color then r, g, b = color.r, color.g, color.b end elseif unit.label == "pet" then local happiness = GetPetHappiness() if happiness == 1 then @@ -1465,7 +1463,7 @@ function pfUI.uf:RefreshUnit(unit, component) end else local color = UnitReactionColor[UnitReaction(unitstr, "player")] - r, g, b = color.r, color.g, color.b + if color then r, g, b = color.r, color.g, color.b end end if C.unitframes.custom == "1" then