mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[c++options] Don't crash when find_option returns nullopt.
This commit is contained in:
parent
062f3fb19d
commit
60c06debce
@ -1311,7 +1311,10 @@ gnc_option_db_lookup_qofinstance_value(GncOptionDB* odb, const char* section,
|
||||
const char* name)
|
||||
{
|
||||
auto option{odb->find_option(section, name)};
|
||||
return option->get_value<const QofInstance*>();
|
||||
if (option)
|
||||
return option->get_value<const QofInstance*>();
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// Force creation of templates
|
||||
|
Loading…
Reference in New Issue
Block a user