diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 5d072ae90..01aac6bc3 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2005-04-26 Martin Hawlisch + * src/EditPerson.py (on_apply_person_clicked): Fix crash when + changing gender caused by a family handle/object mismatch + 2005-04-25 Martin Hawlisch * src/FamilyView.py: Dont crash on empty database diff --git a/gramps2/src/EditPerson.py b/gramps2/src/EditPerson.py index c78be615e..38b5502d7 100644 --- a/gramps2/src/EditPerson.py +++ b/gramps2/src/EditPerson.py @@ -1797,7 +1797,8 @@ class EditPerson: error = False if male and self.person.get_gender() != RelLib.Person.MALE: self.person.set_gender(RelLib.Person.MALE) - for temp_family in self.person.get_family_handle_list(): + for temp_family_handle in self.person.get_family_handle_list(): + temp_family = self.db.get_family_from_handle(temp_family_handle) if self.person == temp_family.get_mother_handle(): if temp_family.get_father_handle() != None: error = True @@ -1806,7 +1807,8 @@ class EditPerson: temp_family.set_father_handle(self.person) elif female and self.person.get_gender() != RelLib.Person.FEMALE: self.person.set_gender(RelLib.Person.FEMALE) - for temp_family in self.person.get_family_handle_list(): + for temp_family_handle in self.person.get_family_handle_list(): + temp_family = self.db.get_family_from_handle(temp_family_handle) if self.person == temp_family.get_father_handle(): if temp_family.get_mother_handle() != None: error = True @@ -1815,7 +1817,8 @@ class EditPerson: temp_family.set_mother_handle(self.person) elif unknown and self.person.get_gender() != RelLib.Person.UNKNOWN: self.person.set_gender(RelLib.Person.UNKNOWN) - for temp_family in self.person.get_family_handle_list(): + for temp_family_handle in self.person.get_family_handle_list(): + temp_family = self.db.get_family_from_handle(temp_family_handle) if self.person == temp_family.get_father_handle(): if temp_family.get_mother_handle() != None: error = True