Fix merge persons when removed person was the Home (default) person (#619)

Fixes #10597

If a person merge removes the default (Home) person, the previous code started having HandleError crashes.
This checks for and corrects this issue.
Did not see the issue with 4.2.x because there were no HandleErrors.
This commit is contained in:
Paul Culley 2018-05-19 22:31:41 -05:00 committed by Sam Manzi
parent aa47410902
commit f2392f910d

View File

@ -182,5 +182,7 @@ class MergePersonQuery:
self.database.commit_family(family, trans) self.database.commit_family(family, trans)
parent_list.append(parents) parent_list.append(parents)
if self.database.get_default_handle() == old_handle:
self.database.set_default_person_handle(None)
self.database.remove_person(old_handle, trans) self.database.remove_person(old_handle, trans)
return family_merge_ok return family_merge_ok