Skip to content

Commit

Permalink
fix: renderer nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
aymanbagabas committed Oct 13, 2022
1 parent 2d5ed08 commit c3e9320
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions style.go
Expand Up @@ -161,6 +161,9 @@ func (s Style) Inherit(i Style) Style {

// Render applies the defined style formatting to a given string.
func (s Style) Render(strs ...string) string {
if s.r == nil {
s.r = DefaultRenderer()
}
if s.value != "" {
strs = append([]string{s.value}, strs...)
}
Expand Down

0 comments on commit c3e9320

Please sign in to comment.