Merge pull request #34 from strogiyotec/null_colors

check if config has any colors
This commit is contained in:
Kevin Schoon 2020-09-08 10:55:56 -05:00 committed by GitHub
commit e030827ffc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 2 deletions

10
util.go
View File

@ -63,12 +63,18 @@ func summerizeTasks(config *Config, tasks []*Task) {
fmt.Printf(" ")
}
// user specified color mapping exists
if color := config.Colors.Get(tag); color != nil {
color.Printf("%s", tag)
if config.Colors != nil {
if color := config.Colors.Get(tag); color != nil {
color.Printf("%s", tag)
} else {
// no color mapping for tag
fmt.Printf("%s", tag)
}
} else {
// no color mapping
fmt.Printf("%s", tag)
}
}
fmt.Printf("]")
}