diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2012-10-09 17:41:17 -0400 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-10-09 17:41:17 -0400 |
commit | 1f4a5bd42cefa816d8ec9c1b7c60b6255150da0e (patch) | |
tree | fe90b4bfa5356c7536e192091d0a77539d4e4beb | |
parent | 438a0785fb47fc1ba9fe9421ed47cc9defb15922 (diff) | |
download | logbot-1f4a5bd42cefa816d8ec9c1b7c60b6255150da0e.tar.xz |
Fix possible KeyError if code is not a color code
-rwxr-xr-x | logbot.py | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -198,6 +198,8 @@ def replace_color(code, text): '36': '00aaaa', '37': 'F5F1DE', } + if code not in colors: + return text return '<span style="color: #%(color)s">%(text)s</span>' % dict( color = colors[code], text = text, |