Permalink
Browse files

Fix possible KeyError if code is not a color code

  • Loading branch information...
1 parent 438a078 commit 1f4a5bd42cefa816d8ec9c1b7c60b6255150da0e @jaraco committed Oct 9, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 logbot.py
View
@@ -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,

0 comments on commit 1f4a5bd

Please sign in to comment.