diff --git a/Kui_Nameplates/Modules/Castbar.lua b/Kui_Nameplates/Modules/Castbar.lua index bd3c7d3..c0ef8c6 100644 --- a/Kui_Nameplates/Modules/Castbar.lua +++ b/Kui_Nameplates/Modules/Castbar.lua @@ -402,13 +402,20 @@ function mod:OnInitialize() self.configChangedFuncs.display.cbheight.ro(sizes.cbheight) -- handle default interface cvars & checkboxes - InterfaceOptionsCombatPanel:HookScript( - "OnShow", - function() - InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true) - InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable() - end - ) + -- The CoA client's reworked Settings panel may not expose these legacy + -- globals; guard each access so a missing widget cannot error every time + -- the Combat options panel is shown. + if InterfaceOptionsCombatPanel then + InterfaceOptionsCombatPanel:HookScript( + "OnShow", + function() + if InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates then + InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:SetChecked(true) + InterfaceOptionsCombatPanelEnemyCastBarsOnNameplates:Disable() + end + end + ) + end InterfaceOptionsFrame:HookScript( "OnHide", function() diff --git a/Kui_Nameplates/Modules/ClassColours.lua b/Kui_Nameplates/Modules/ClassColours.lua index 76617e6..7f8402a 100644 --- a/Kui_Nameplates/Modules/ClassColours.lua +++ b/Kui_Nameplates/Modules/ClassColours.lua @@ -94,11 +94,18 @@ function mod:OnInitialize() self:SetEnabledState(self.db.profile.friendly) -- handle default interface cvars & checkboxes - InterfaceOptionsCombatPanel:HookScript("OnShow", function() - InterfaceOptionsCombatPanelNameplateClassColors:Disable() - InterfaceOptionsCombatPanelNameplateClassColors:SetChecked(mod.db.profile.enemy) - InterfaceOptionsCombatPanelNameplateClassColors.Enable = function() return end - end) + -- The CoA client's reworked Settings panel does not expose the legacy + -- InterfaceOptionsCombatPanel / NameplateClassColors checkbox, so guard + -- every access to avoid indexing a nil global. + if InterfaceOptionsCombatPanel then + InterfaceOptionsCombatPanel:HookScript("OnShow", function() + if InterfaceOptionsCombatPanelNameplateClassColors then + InterfaceOptionsCombatPanelNameplateClassColors:Disable() + InterfaceOptionsCombatPanelNameplateClassColors:SetChecked(mod.db.profile.enemy) + InterfaceOptionsCombatPanelNameplateClassColors.Enable = function() return end + end + end) + end InterfaceOptionsFrame:HookScript("OnHide", function() SetCVars() end) SetCVars() end