fix: Don't log error for not finding header when running in headless mode (#3112)

mine
Erich Fussi 2025-03-07 17:42:22 +01:00 committed by GitHub
parent b3cd073938
commit 582cca37d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 4 deletions

View File

@ -123,11 +123,13 @@ func (a *App) StylesChanged(s *config.Styles) {
a.Main.SetBackgroundColor(s.BgColor())
if f, ok := a.Main.GetPrimitive("main").(*tview.Flex); ok {
f.SetBackgroundColor(s.BgColor())
if !a.Config.K9s.IsHeadless() {
if h, ok := f.ItemAt(0).(*tview.Flex); ok {
h.SetBackgroundColor(s.BgColor())
} else {
log.Error().Msgf("Header not found")
}
}
} else {
log.Error().Msgf("Main not found")
}