From 08c54e0d2ee3cf57e20cbf63eb16090b49d43524 Mon Sep 17 00:00:00 2001 From: Brian Matherly Date: Sat, 2 Feb 2008 21:23:08 +0000 Subject: [PATCH] 0001702: invoking family group reports crashes gramps svn: r9986 --- ChangeLog | 5 +++++ src/PluginUtils/_GuiOptions.py | 5 +++-- src/plugins/FamilyGroup.py | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad3b597cc..6707e1dbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-02 Brian Matherly + * src/PluginUtils/_GuiOptions.py: + * src/plugins/FamilyGroup.py: + 0001702: invoking family group reports crashes gramps + 2008-02-02 Brian Matherly * src/ReportBase/_Endnotes.py: 0001704: Det. anc. report - newline needed after endnote entries. diff --git a/src/PluginUtils/_GuiOptions.py b/src/PluginUtils/_GuiOptions.py index 7472f15bc..588a4d7a3 100644 --- a/src/PluginUtils/_GuiOptions.py +++ b/src/PluginUtils/_GuiOptions.py @@ -516,8 +516,9 @@ class GuiFamilyOption(gtk.HBox): # Finally, take any family you can find. family_list = self.__db.get_family_handles() - family = self.__db.get_family_from_handle(family_list[0]) - self.__update_family(family) + if family_list: + family = self.__db.get_family_from_handle(family_list[0]) + self.__update_family(family) def __get_family_clicked(self, obj): # IGNORE:W0613 - obj is unused """ diff --git a/src/plugins/FamilyGroup.py b/src/plugins/FamilyGroup.py index f48b35e78..546683d39 100644 --- a/src/plugins/FamilyGroup.py +++ b/src/plugins/FamilyGroup.py @@ -67,7 +67,10 @@ class FamilyGroup(Report): family_id = menu.get_option_by_name('family_id').get_value() family = database.get_family_from_gramps_id(family_id) - self.family_handle = family.get_handle() + if family: + self.family_handle = family.get_handle() + else: + self.family_handle = None self.recursive = menu.get_option_by_name('recursive').get_value() self.missingInfo = menu.get_option_by_name('missinginfo').get_value()