From f6aead38f0d5460bd249eff75df7c234ff6ee8a4 Mon Sep 17 00:00:00 2001
From: Martin Hawlisch <martin.hawlisch@gmx.de>
Date: Mon, 28 Nov 2005 13:56:29 +0000
Subject: [PATCH] * src/FamilyView.py (change_families): Avoid exception if
 family does not contain parents

svn: r5446
---
 gramps2/ChangeLog         | 2 ++
 gramps2/src/FamilyView.py | 5 ++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog
index 665453280..3b93fb507 100644
--- a/gramps2/ChangeLog
+++ b/gramps2/ChangeLog
@@ -1,5 +1,7 @@
 2005-11-28  Martin Hawlisch  <Martin.Hawlisch@gmx.de>
 	* NEWS: Better support for unicode filenames
+	* src/FamilyView.py (change_families): Avoid exception if family
+	 does not contain parents
 
 2005-11-28  Julio Sanchez  <jsanchez@users.sourceforge.net>
 	* src/DateParser.py: match modifiers in reverse length order so that
diff --git a/gramps2/src/FamilyView.py b/gramps2/src/FamilyView.py
index 4b48a49e2..93b84f287 100644
--- a/gramps2/src/FamilyView.py
+++ b/gramps2/src/FamilyView.py
@@ -941,8 +941,11 @@ class FamilyView:
 
         if family.get_father_handle():
             person_handle = family.get_father_handle()
-        else:
+        elif family.get_mother_handle():
             person_handle = family.get_mother_handle()
+        else:
+            #family does not contain parants
+            return
         person = self.parent.db.get_person_from_handle(person_handle)
         self.parent.change_active_person(person)