From 63d2b8f06f81f6fdc5b36af67b493ca3cc6c7865 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Mon, 10 Jan 2011 18:59:34 +0100 Subject: Avoid traceback on text_win refresh --- src/tabs.py | 2 +- src/windows.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tabs.py b/src/tabs.py index 1cec7b28..74dc468d 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -605,7 +605,7 @@ class MucTab(ChatTab): def on_gain_focus(self): self._room.set_color_state(theme.COLOR_TAB_CURRENT) - if self.text_win.built_lines[-1] is None: + if self.text_win.built_lines and self.text_win.built_lines[-1] is None: self.text_win.remove_line_separator() curses.curs_set(1) diff --git a/src/windows.py b/src/windows.py index e4b5bcb4..5ac3c5e3 100644 --- a/src/windows.py +++ b/src/windows.py @@ -551,7 +551,7 @@ class TextWin(Win): if line.nickname: self.write_nickname(line.nickname, line.nickname_color) self.write_text(y, line.text_offset, line.text, line.text_color, line.colorized) - if y != self.height-1 and line.text_offset+len(line.text) < self.width: + if y != self.height-1 or (not line or line.text_offset+len(line.text) < self.width): self.addstr('\n') self._refresh() -- cgit v1.2.3