From 19e0f58763497ba4c40de613ac7d21f706bbca2d Mon Sep 17 00:00:00 2001 From: Robert Fewell <14uBobIT@gmail.com> Date: Sat, 30 Dec 2017 17:14:17 +0000 Subject: [PATCH] Fix Critical errors when SX editor loaded When the SX editor is loaded, an embedded register plug-in page is created and as part of this the business menus and actions are updated. As this is an GncEmbeddedWindow they fail so test for a normal main window before proceeding. --- gnucash/gnome/gnc-plugin-business.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnucash/gnome/gnc-plugin-business.c b/gnucash/gnome/gnc-plugin-business.c index daad4491d3..eb418b345c 100644 --- a/gnucash/gnome/gnc-plugin-business.c +++ b/gnucash/gnome/gnc-plugin-business.c @@ -910,6 +910,10 @@ gnc_plugin_business_update_menus (GncPluginPage *plugin_page) if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page)) return; + // Check that this is a main window and not embedded sx + if (!GNC_IS_MAIN_WINDOW(plugin_page->window)) + return; + is_txn_register = GNC_IS_PLUGIN_PAGE_REGISTER(plugin_page); window = GNC_MAIN_WINDOW(plugin_page->window); g_return_if_fail(GNC_IS_MAIN_WINDOW(window)); @@ -1055,6 +1059,10 @@ static void update_inactive_actions(GncPluginPage *plugin_page) if (!plugin_page || !GNC_IS_PLUGIN_PAGE(plugin_page)) return; + // Check that this is a main window and not embedded sx + if (!GNC_IS_MAIN_WINDOW(plugin_page->window)) + return; + window = GNC_MAIN_WINDOW(plugin_page->window); g_return_if_fail(GNC_IS_MAIN_WINDOW(window)); action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);