From a8c4b1adf477beda6c133d7c4feaeccbca0d4aee Mon Sep 17 00:00:00 2001 From: Josue Ortega Date: Sat, 16 Sep 2017 12:58:12 -0600 Subject: [PATCH] Fix crash when submission page contains non standard characters --- rtv/terminal.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/rtv/terminal.py b/rtv/terminal.py index 9e5218c..98d2af2 100644 --- a/rtv/terminal.py +++ b/rtv/terminal.py @@ -270,9 +270,13 @@ class Terminal(object): # Trying to draw outside of the screen bounds return - text = self.clean(text, n_cols) - params = [] if attr is None else [attr] - window.addstr(row, col, text, *params) + try: + text = self.clean(text, n_cols) + params = [] if attr is None else [attr] + window.addstr(row, col, text, *params) + except curses.error as e: + _logger.warning('add_line raised an exception') + _logger.exception(str(e)) @staticmethod def add_space(window):