From 0a981f0ca66de3421bad411f885811acedaebe3d Mon Sep 17 00:00:00 2001 From: SNoiraud Date: Wed, 8 Jun 2022 08:38:20 +0200 Subject: [PATCH] Check that view exists before calling post_create method Avoids 'NoneType' object has no attribute 'post_create' error. Fixes #12638 --- gramps/gui/viewmanager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gramps/gui/viewmanager.py b/gramps/gui/viewmanager.py index 6160f47fa..eb046c632 100644 --- a/gramps/gui/viewmanager.py +++ b/gramps/gui/viewmanager.py @@ -842,7 +842,8 @@ class ViewManager(CLIManager): hbox.add(Gtk.Label(label=pdata.name)) hbox.show_all() page_num = self.notebook.append_page(page.get_display(), hbox) - self.active_page.post_create() + if self.active_page: + self.active_page.post_create() if not self.file_loaded: self.uimanager.set_actions_visible(self.actiongroup, False) self.uimanager.set_actions_visible(self.readonlygroup, False)