summaryrefslogtreecommitdiff
path: root/src
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-07 19:54:12 +0100
commit15780364cf13de0bd4c2a40d895fe77273f00ab9 (patch)
treef92b42080791840aae985433703230fb2532bc0c /src
parentcd16403cb486df2c68da4af1e45b16a3c6687edd (diff)
downloadpoezio-15780364cf13de0bd4c2a40d895fe77273f00ab9.tar.gz
poezio-15780364cf13de0bd4c2a40d895fe77273f00ab9.tar.bz2
poezio-15780364cf13de0bd4c2a40d895fe77273f00ab9.tar.xz
poezio-15780364cf13de0bd4c2a40d895fe77273f00ab9.zip
avoid a crash on invalid colors
Diffstat (limited to 'src')
-rw-r--r--src/windows.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/windows.py b/src/windows.py
index 790dd858..1ff8f858 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -138,7 +138,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:]