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 authored and Sam Manzi committed 2018-05-20 13:31:41 +10:00
1 parent aa47410902
commit f2392f910d
1 file changed
+2
+2
View File
@@ -182,5 +182,7 @@ class MergePersonQuery:
self.database.commit_family(family, trans)
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)
return family_merge_ok