From d6dd1dc2217e503ce5b142e1dbefe257fc117a7d Mon Sep 17 00:00:00 2001 From: Paul Culley Date: Tue, 27 Nov 2018 21:56:36 -0600 Subject: [PATCH] Fix Statusbar update to avoid intermittent exception on closed db (#716) Fixes #10882 --- gramps/gui/displaystate.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gramps/gui/displaystate.py b/gramps/gui/displaystate.py index 936bc9d60..f3ca7b516 100644 --- a/gramps/gui/displaystate.py +++ b/gramps/gui/displaystate.py @@ -621,19 +621,17 @@ class DisplayState(Callback): self.status.pop(self.status_id) - if active_handle: + if active_handle and dbstate.is_open(): name, obj = navigation_label(dbstate.db, nav_type, active_handle) + # Append relationship to default person if funtionality is enabled. + if nav_type == 'Person' and config.get('interface.statusbar') > 1: + if active_handle != dbstate.db.get_default_handle(): + msg = self.display_relationship(dbstate, active_handle) + if msg: + name = '%s (%s)' % (name, msg.strip()) else: name = _('No active object') - # Append relationship to default person if funtionality is enabled. - if nav_type == 'Person' and active_handle \ - and config.get('interface.statusbar') > 1: - if active_handle != dbstate.db.get_default_handle(): - msg = self.display_relationship(dbstate, active_handle) - if msg: - name = '%s (%s)' % (name, msg.strip()) - if not name: name = self.NAV2MES[nav_type]