mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
std::string(char*) crashes if it's given a nullptr.
This commit is contained in:
parent
b6622a386b
commit
f0ecc0e2eb
@ -2320,8 +2320,11 @@ public:
|
||||
{
|
||||
auto string = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(get_widget()));
|
||||
DEBUG("filename %s", string ? string : "(null)");
|
||||
option.set_value(std::string{string});
|
||||
g_free(string);
|
||||
if (string)
|
||||
{
|
||||
option.set_value(std::string{string});
|
||||
g_free(string);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user