From 0ae24d7fb57bbf5997cd57e79ff887ff0322b3f4 Mon Sep 17 00:00:00 2001 From: Christian Jacobs Date: Sun, 24 Mar 2013 00:20:24 +0000 Subject: [PATCH] If a record in row n has just been deleted then the tree will automatically go to row n+1 after deletion, rather than staying at row n. Since row n+1 might not have a record associated with it, let's do some error handling. --- src/pyqso.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pyqso.py b/src/pyqso.py index 723761c..a44458d 100644 --- a/src/pyqso.py +++ b/src/pyqso.py @@ -159,6 +159,9 @@ class PyQSO(Gtk.Window): logging.debug("Could not find the selected row's index!") return + if(index > self.logbook.get_number_of_records()-1): + index = self.logbook.get_number_of_records()-1 + record = self.logbook.get_record(index) field_names = self.logbook.SELECTED_FIELD_NAMES_TYPES.keys() for i in range(0, len(field_names)):