Author: Kevin Schoon [kevinschoon@gmail.com]
Committer: GitHub [noreply@github.com] Tue, 08 Sep 2020 15:55:56 +0000
Hash: e030827ffc30d00e5dab316ea66c466a6bc37915
Timestamp: Tue, 08 Sep 2020 15:55:56 +0000 (4 years ago)

+8 -2 +/-1 browse
Merge pull request #34 from strogiyotec/null_colors
Merge pull request #34 from strogiyotec/null_colors

check if config has any colors
1diff --git a/util.go b/util.go
2index 5ecb373..4c2425f 100644
3--- a/util.go
4+++ b/util.go
5 @@ -63,12 +63,18 @@ func summerizeTasks(config *Config, tasks []*Task) {
6 fmt.Printf(" ")
7 }
8 // user specified color mapping exists
9- if color := config.Colors.Get(tag); color != nil {
10- color.Printf("%s", tag)
11+ if config.Colors != nil {
12+ if color := config.Colors.Get(tag); color != nil {
13+ color.Printf("%s", tag)
14+ } else {
15+ // no color mapping for tag
16+ fmt.Printf("%s", tag)
17+ }
18 } else {
19 // no color mapping
20 fmt.Printf("%s", tag)
21 }
22+
23 }
24 fmt.Printf("]")
25 }