[gnc-main-window] Fix null pointer dereference when opening existing pages

When the page already exists in a window then we can't be restoring pages
so stop checking. The "window" variable will be nullptr if we're trying to
open the page "in any window".

This bug was introduced in the changes for bug 798564.
This commit is contained in:
Simon Arlott 2023-06-23 17:18:05 +01:00
parent 6b48c6ced7
commit 54d0a535ab
No known key found for this signature in database
GPG Key ID: DF001BFD83E75990

View File

@ -3189,8 +3189,7 @@ gnc_main_window_open_page (GncMainWindow *window,
if (gnc_main_window_page_exists(page))
{
if (!gnc_main_window_is_restoring_pages (window))
gnc_main_window_display_page (page);
gnc_main_window_display_page (page);
return;
}