summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-07 19:54:12 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-08 00:14:24 +0100
commit2c9cbc9f58cd167ba6a77932a57f50ca219b60a8 (patch)
tree15260c337b1b2bc3914da648b2c6fe904d01ed4a /src/windows.py
parent27f28f26243c2310dcfd3540e2b736a634b48faf (diff)
downloadpoezio-2c9cbc9f58cd167ba6a77932a57f50ca219b60a8.tar.gz
poezio-2c9cbc9f58cd167ba6a77932a57f50ca219b60a8.tar.bz2
poezio-2c9cbc9f58cd167ba6a77932a57f50ca219b60a8.tar.xz
poezio-2c9cbc9f58cd167ba6a77932a57f50ca219b60a8.zip
avoid a crash on invalid colors
(cherry picked from commit 15780364cf13de0bd4c2a40d895fe77273f00ab9)
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py
index f399d940..9fa3e705 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -135,7 +135,8 @@ class Win(object):
self._win.attron(curses.A_BOLD)
if attr_char in string.digits and attr_char != '':
color_str = text[next_attr_char+1:text.find('}', next_attr_char)]
- self._win.attron(to_curses_attr((int(color_str), -1)))
+ if color_str:
+ self._win.attron(to_curses_attr((int(color_str), -1)))
text = text[next_attr_char+len(color_str)+2:]
else:
text = text[next_attr_char+2:]