Fix crash

bzr-revno: 457
This commit is contained in:
Tim Bentley 2009-06-05 17:25:32 +01:00
commit e48b20021d
1 changed files with 2 additions and 0 deletions

View File

@ -59,6 +59,8 @@ class TextListData(QtCore.QAbstractListModel):
if row > len(self.items): # if the last row is selected and deleted, we then get called with an empty row!
return QtCore.QVariant()
if role == QtCore.Qt.DisplayRole:
if row == self.rowCount(None):
row -= 1
retval = self.items[row][1]
else:
retval = QtCore.QVariant()