Fix list index out of range

When clicking with the mouse in rows without links, gertty
crashes.

Change-Id: I0005d76a6804cbdd2d366c6e07f15c1316cfed90
This commit is contained in:
Matthias Runge 2015-12-21 13:54:06 +01:00 committed by James E. Blair
parent 0e80bbf217
commit 9b931602a6
1 changed files with 5 additions and 1 deletions

View File

@ -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