From 8fc7b3d29f39c30de202c6504aecbcd3849667c9 Mon Sep 17 00:00:00 2001 From: shagu Date: Sat, 15 Apr 2017 18:59:50 +0200 Subject: [PATCH] api: check for variable before use --- api/unitframes.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/unitframes.lua b/api/unitframes.lua index d8750b31..776eedbb 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1195,7 +1195,9 @@ function pfUI.uf.GetColor(self, preset) if preset == "unit" then if UnitIsPlayer(unitstr) then local _, class = UnitClass(unitstr) - r, g, b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b + if RAID_CLASS_COLORS[class] then + r, g, b = RAID_CLASS_COLORS[class].r, RAID_CLASS_COLORS[class].g, RAID_CLASS_COLORS[class].b + end else if UnitReactionColor[UnitReaction(unitstr, "player")] then r, g, b = UnitReactionColor[UnitReaction(unitstr, "player")].r, UnitReactionColor[UnitReaction(unitstr, "player")].g, UnitReactionColor[UnitReaction(unitstr, "player")].b