From 77c0645acfbad2290a0b9a1d26b3f4d1149d8b69 Mon Sep 17 00:00:00 2001 From: John Ralls Date: Tue, 22 Jan 2013 19:21:17 +0000 Subject: [PATCH] Fix unhandled exception in expandersidebar svn: r21198 --- gramps/plugins/sidebar/expandersidebar.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/plugins/sidebar/expandersidebar.py b/gramps/plugins/sidebar/expandersidebar.py index ab844bca0..50b8b0993 100644 --- a/gramps/plugins/sidebar/expandersidebar.py +++ b/gramps/plugins/sidebar/expandersidebar.py @@ -29,6 +29,7 @@ # #------------------------------------------------------------------------- from gi.repository import Gtk +import logging #------------------------------------------------------------------------- # @@ -110,7 +111,11 @@ class ExpanderSidebar(BaseSidebar): if cat_num is not None: self.expanders[cat_num].set_expanded(True) # Set new button as selected - button_num = self.lookup[(cat_num, view_num)] + try: + button_num = self.lookup[(cat_num, view_num)] + except KeyError as err: + logging.warning("Key Error retrieving button number: %s" % str(err)) + button_num = 0 self.__handlers_block() for index, button in enumerate(self.buttons): if index == button_num: