From 7d9f4dcc804fd7369c14a43d21912b68ce3b892d Mon Sep 17 00:00:00 2001 From: Ivan Date: Tue, 4 Sep 2018 07:38:42 +0600 Subject: [PATCH] [Whatsnext] check if db is open (#651) Fixes #10732 --- gramps/plugins/gramplet/whatsnext.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gramps/plugins/gramplet/whatsnext.py b/gramps/plugins/gramplet/whatsnext.py index d44ca255b..56d3420b6 100644 --- a/gramps/plugins/gramplet/whatsnext.py +++ b/gramps/plugins/gramplet/whatsnext.py @@ -93,12 +93,13 @@ class WhatNextGramplet(Gramplet): self.opts[3].add_item('', '') self.opts[4].add_item('', '') self.opts[5].add_item('', '') - for tag_handle in self.dbstate.db.get_tag_handles(sort_handles=True): - tag = self.dbstate.db.get_tag_from_handle(tag_handle) - tag_name = tag.get_name() - self.opts[3].add_item(tag_name, tag_name) - self.opts[4].add_item(tag_name, tag_name) - self.opts[5].add_item(tag_name, tag_name) + if self.dbstate.db.is_open(): + for tag_handle in self.dbstate.db.get_tag_handles(sort_handles=True): + tag = self.dbstate.db.get_tag_from_handle(tag_handle) + tag_name = tag.get_name() + self.opts[3].add_item(tag_name, tag_name) + self.opts[4].add_item(tag_name, tag_name) + self.opts[5].add_item(tag_name, tag_name) list(map(self.add_option, self.opts))