diff --git a/src/types/unitframe.lua b/src/types/unitframe.lua index bc05890..01ff008 100644 --- a/src/types/unitframe.lua +++ b/src/types/unitframe.lua @@ -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)