mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 12:30:50 +00:00
api: check for variable before use
This commit is contained in:
+3
-1
@@ -1195,7 +1195,9 @@ function pfUI.uf.GetColor(self, preset)
|
|||||||
if preset == "unit" then
|
if preset == "unit" then
|
||||||
if UnitIsPlayer(unitstr) then
|
if UnitIsPlayer(unitstr) then
|
||||||
local _, class = UnitClass(unitstr)
|
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
|
else
|
||||||
if UnitReactionColor[UnitReaction(unitstr, "player")] then
|
if UnitReactionColor[UnitReaction(unitstr, "player")] then
|
||||||
r, g, b = UnitReactionColor[UnitReaction(unitstr, "player")].r, UnitReactionColor[UnitReaction(unitstr, "player")].g, UnitReactionColor[UnitReaction(unitstr, "player")].b
|
r, g, b = UnitReactionColor[UnitReaction(unitstr, "player")].r, UnitReactionColor[UnitReaction(unitstr, "player")].g, UnitReactionColor[UnitReaction(unitstr, "player")].b
|
||||||
|
|||||||
Reference in New Issue
Block a user