From 85a000ce674d1a019e1c1973afa58675292b79ee Mon Sep 17 00:00:00 2001
From: Doug Blank <dblank@cs.brynmawr.edu>
Date: Mon, 13 Jul 2015 13:19:59 -0400
Subject: [PATCH] events gramplet: check for existing family

---
 gramps/plugins/gramplet/events.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py
index 86ad250d8..ad20f2556 100644
--- a/gramps/plugins/gramplet/events.py
+++ b/gramps/plugins/gramplet/events.py
@@ -174,8 +174,9 @@ class PersonEvents(Events):
                 return True
             for family_handle in active_person.get_family_handle_list():
                 family = self.dbstate.db.get_family_from_handle(family_handle)
-                for event_ref in family.get_event_ref_list():
-                    return True
+                if family:
+                    for event_ref in family.get_event_ref_list():
+                        return True
         return False
 
     def main(self): # return false finishes