Commit 63d2b8f0 authored by louiz’'s avatar louiz’

Avoid traceback on text_win refresh

parent 97ee65fc
...@@ -605,7 +605,7 @@ class MucTab(ChatTab): ...@@ -605,7 +605,7 @@ class MucTab(ChatTab):
def on_gain_focus(self): def on_gain_focus(self):
self._room.set_color_state(theme.COLOR_TAB_CURRENT) 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() self.text_win.remove_line_separator()
curses.curs_set(1) curses.curs_set(1)
...@@ -551,7 +551,7 @@ class TextWin(Win): ...@@ -551,7 +551,7 @@ class TextWin(Win):
if line.nickname: if line.nickname:
self.write_nickname(line.nickname, line.nickname_color) self.write_nickname(line.nickname, line.nickname_color)
self.write_text(y, line.text_offset, line.text, line.text_color, line.colorized) 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.addstr('\n')
self._refresh() self._refresh()
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment