Fix unhandled exception in expandersidebar

svn: r21198
This commit is contained in:
John Ralls 2013-01-22 19:21:17 +00:00
parent 88f3176f91
commit 77c0645acf

View File

@ -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: