Skip to content

Commit

Permalink
Don't crash if the option set doesn't set a default section.
Browse files Browse the repository at this point in the history
  • Loading branch information
jralls committed Aug 1, 2021
1 parent 7cb27b2 commit 2dd8d78
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions gnucash/gnome-utils/dialog-options.cpp
Expand Up @@ -542,13 +542,14 @@ gnc_options_dialog_build_contents_full (GNCOptionWin *propertybox,
auto num_sections = odb->num_sections();
auto default_section = odb->get_default_section();

PINFO("Default Section name is %s", default_section->get_name().c_str());
PINFO("Default Section name is %s",
default_section ? default_section->get_name().c_str() : "NULL");

odb->foreach_section(
[propertybox, default_section, &default_page]
(GncOptionSectionPtr& section) {
auto page = gnc_options_dialog_append_page(propertybox, section);
if (section.get() == default_section)
if (default_section && section.get() == default_section)
default_page = page;
});

Expand Down

0 comments on commit 2dd8d78

Please sign in to comment.