mirror of
https://github.com/rwinkhart/glamour-temp-MUTN.git
synced 2026-09-06 08:57:14 -04:00
Fix nil pointer access when style is unused
This commit is contained in:
+2
-2
@@ -49,8 +49,8 @@ func renderText(w io.Writer, rules *ElementStyle, s string) {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: ugly hack
|
// FIXME: ugly true-color ANSI support hack
|
||||||
if os.Getenv("COLORTERM") == "truecolor" {
|
if rules != nil && os.Getenv("COLORTERM") == "truecolor" {
|
||||||
bg, err := colorSeq(rules.BackgroundColor)
|
bg, err := colorSeq(rules.BackgroundColor)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
s = "\x1b[48;2;" + bg + s
|
s = "\x1b[48;2;" + bg + s
|
||||||
|
|||||||
Reference in New Issue
Block a user