Fix crash in case of empty history

Without that check, an empty history causes a crash
This commit is contained in:
Salvo 'LtWorf' Tomaselli 2016-01-02 15:59:02 +01:00
parent 8ccf4d51a4
commit 6315bebc61

View File

@ -88,6 +88,8 @@ class relForm(QtWidgets.QMainWindow):
if self.history_current_line is None:
self.history_current_line = self.ui.txtQuery.text()
if self.ui.lstHistory.currentItem() is None:
return
if not self.ui.lstHistory.currentItem().text() != self.ui.txtQuery.text():
self.ui.lstHistory.setCurrentRow(self.ui.lstHistory.currentRow()-1)
elif self.ui.lstHistory.currentRow() > 0: