From b1c98862d7a37635e4d491cc857cfa5704fb2f0a Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Tue, 11 Jan 2011 13:15:32 +0000 Subject: [PATCH] Fix bug with views containing an empty bottombar svn: r16363 --- src/gui/bottombar.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/bottombar.py b/src/gui/bottombar.py index d51fa5cfa..f0fe17e13 100644 --- a/src/gui/bottombar.py +++ b/src/gui/bottombar.py @@ -233,7 +233,7 @@ class Bottombar(object): """ page = self.notebook.get_current_page() title = get_title(self.notebook, page) - if self.gramplet_map[title].pui: + if title is not None and self.gramplet_map[title].pui: self.gramplet_map[title].pui.active = True if self.gramplet_map[title].pui.dirty: self.gramplet_map[title].pui.update() @@ -244,7 +244,7 @@ class Bottombar(object): """ page = self.notebook.get_current_page() title = get_title(self.notebook, page) - if self.gramplet_map[title].pui: + if title is not None and self.gramplet_map[title].pui: if self.gramplet_map[title].state != "detached": self.gramplet_map[title].pui.active = False @@ -344,7 +344,11 @@ def get_title(notebook, page_num): """ Reurn the title of a given page in a notebook. """ - return notebook.get_tab_label_text(notebook.get_nth_page(page_num)) + page = notebook.get_nth_page(page_num) + if page is None: + return None + else: + return notebook.get_tab_label_text(page) #------------------------------------------------------------------------- #