From fb39bcba80d6a735b233526cae82b88209665c38 Mon Sep 17 00:00:00 2001 From: "Anand Babu (AB) Periasamy" Date: Sat, 14 Nov 2015 20:38:47 -0800 Subject: [PATCH] handle non-existant color calls --- pkg/console/console.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/console/console.go b/pkg/console/console.go index 8e026b2e..1da3285b 100644 --- a/pkg/console/console.go +++ b/pkg/console/console.go @@ -175,7 +175,10 @@ var ( // Colorize prints message in a colorized form, dictated by the corresponding tag argument. Colorize = func(tag string, data interface{}) string { if isatty.IsTerminal(os.Stdout.Fd()) { - return Theme[tag].SprintFunc()(data) + colorized, ok := Theme[tag] + if ok { + return colorized.SprintFunc()(data) + } // else: No theme found. Return as string. } return fmt.Sprint(data) }