mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Errors in trace file if account deleted with open register
If an account is deleted with an open register there are multiple errors in trace file due to the register plugin page event handler trying to update the notebook tab contents. Add a test for the ledger display leader being not NULL before trying to update the tab contents.
This commit is contained in:
@@ -5335,6 +5335,14 @@ gnc_plugin_page_register_event_handler (QofInstance* entity,
|
||||
{
|
||||
if (GNC_IS_MAIN_WINDOW (window))
|
||||
{
|
||||
GncPluginPageRegisterPrivate *priv = GNC_PLUGIN_PAGE_REGISTER_GET_PRIVATE (page);
|
||||
|
||||
if (!gnc_ledger_display_leader (priv->ledger))
|
||||
{
|
||||
LEAVE ("account is NULL");
|
||||
return;
|
||||
}
|
||||
|
||||
gchar *name = gnc_plugin_page_register_get_tab_name (GNC_PLUGIN_PAGE (page));
|
||||
main_window_update_page_name (GNC_PLUGIN_PAGE (page), name);
|
||||
|
||||
@@ -5350,7 +5358,7 @@ gnc_plugin_page_register_event_handler (QofInstance* entity,
|
||||
g_free (name);
|
||||
g_free (long_name);
|
||||
}
|
||||
LEAVE ("tab name updated");
|
||||
LEAVE ("tab contents updated");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user