Skip to content

Commit

Permalink
fix(ui): handle missing selection color theme gracefully
Browse files Browse the repository at this point in the history
- Add nil check for selection color to prevent potential nil pointer dereference
- Fall back to default style if selection color is not defined
  • Loading branch information
wellcomez committed Nov 11, 2024
1 parent 82f0bee commit 180abd2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/ui/uicolortheme.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,11 @@ type symbol_colortheme struct {
}

func (c symbol_colortheme) select_style() *tcell.Style {
return c.get_color("selection")
if style:=c.get_color("selection");style!=nil{
return style
}
s:= c.get_default_style()
return s
}
func (mgr symbol_colortheme) get_styles(names []string) (tcell.Style, error) {
for _, v := range names {
Expand Down

0 comments on commit 180abd2

Please sign in to comment.