From 9b931602a6678fcf3e529a052bc62440ff8b122c Mon Sep 17 00:00:00 2001 From: Matthias Runge Date: Mon, 21 Dec 2015 13:54:06 +0100 Subject: [PATCH] Fix list index out of range When clicking with the mouse in rows without links, gertty crashes. Change-Id: I0005d76a6804cbdd2d366c6e07f15c1316cfed90 --- gertty/mywid.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gertty/mywid.py b/gertty/mywid.py index 64a0285..9151f86 100644 --- a/gertty/mywid.py +++ b/gertty/mywid.py @@ -319,7 +319,11 @@ class HyperText(urwid.Text): def getPosAtCoords(self, maxcol, col, row): trans = self.get_line_translation(maxcol) colpos = 0 - line = trans[row] + line = None + try: + line = trans[row] + except IndexError: + return None for t in line: if len(t) == 2: width, pos = t