Handle characters that aren't fully loaded yet in UpdateName
This commit is contained in:
@@ -446,7 +446,10 @@ end
|
||||
function UnitFrame:UpdateName()
|
||||
if UnitIsPlayer(self.unit) then
|
||||
local _, class = UnitClass(self.unit)
|
||||
local color = RAID_CLASS_COLORS[class]
|
||||
-- TODO: UnitClass can return Unknown and the color can be nil. Having
|
||||
-- the unit exist but not fully loaded is possibly a state we want to
|
||||
-- handle more generally
|
||||
local color = RAID_CLASS_COLORS[class] or {r=1, g=1, b=1}
|
||||
self.name:SetTextColor(color.r, color.g, color.b)
|
||||
else
|
||||
self.name:SetTextColor(1, 1, 1)
|
||||
|
Reference in New Issue
Block a user