Workaround to prevent segfault when accessing page_list->data when page_list is NULL

This commit is contained in:
Christoph Holtermann 2018-12-15 05:26:06 +01:00 committed by c-holtermann
parent 03927f8eee
commit dfc6b1ed04

View File

@ -446,10 +446,10 @@ gnc_plugin_page_account_tree_init (GncPluginPageAccountTree *plugin_page)
/* Is this the first accounts page? */
page_list =
gnc_gobject_tracking_get_list(GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME);
if (plugin_page == page_list->data)
if (!page_list || plugin_page == page_list->data)
{
g_object_set_data(G_OBJECT(plugin_page), PLUGIN_PAGE_IMMUTABLE,
GINT_TO_POINTER(1));
GINT_TO_POINTER(1));
}
/* Create menu and toolbar information */