From 1f4a5bd42cefa816d8ec9c1b7c60b6255150da0e Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Tue, 9 Oct 2012 17:41:17 -0400 Subject: Fix possible KeyError if code is not a color code --- logbot.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/logbot.py b/logbot.py index b7cc694..3bc5dd1 100755 --- a/logbot.py +++ b/logbot.py @@ -198,6 +198,8 @@ def replace_color(code, text): '36': '00aaaa', '37': 'F5F1DE', } + if code not in colors: + return text return '%(text)s' % dict( color = colors[code], text = text, -- cgit v1.2.3