From 6315bebc61ce167be79bd737df838353aef2648c Mon Sep 17 00:00:00 2001 From: Salvo 'LtWorf' Tomaselli Date: Sat, 2 Jan 2016 15:59:02 +0100 Subject: [PATCH] Fix crash in case of empty history Without that check, an empty history causes a crash --- relational_gui/guihandler.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/relational_gui/guihandler.py b/relational_gui/guihandler.py index 2c4a252..79c0b95 100644 --- a/relational_gui/guihandler.py +++ b/relational_gui/guihandler.py @@ -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: