diff --git a/gramps/plugins/gramplet/events.py b/gramps/plugins/gramplet/events.py index be0eabe5a..df34183ec 100644 --- a/gramps/plugins/gramplet/events.py +++ b/gramps/plugins/gramplet/events.py @@ -169,11 +169,10 @@ class PersonEvents(Events): def update_has_data(self): active_handle = self.get_active('Person') + active = None if active_handle: active = self.dbstate.db.get_person_from_handle(active_handle) - self.set_has_data(self.get_has_data(active)) - else: - self.set_has_data(False) + self.set_has_data(self.get_has_data(active)) def get_has_data(self, active_person): """ @@ -248,11 +247,10 @@ class FamilyEvents(Events): def update_has_data(self): active_handle = self.get_active('Family') + active = None if active_handle: active = self.dbstate.db.get_family_from_handle(active_handle) - self.set_has_data(self.get_has_data(active)) - else: - self.set_has_data(False) + self.set_has_data(self.get_has_data(active)) def get_has_data(self, active_family): """