Bug 773808 - Export Report Crash

It's possible for the GtkFileChooserDialog to return a NULL filename,
so defend against that.
This commit is contained in:
John Ralls 2016-12-11 09:58:54 -08:00
parent ad1ba56105
commit ad208810f0

View File

@ -174,6 +174,8 @@ gnc_file_dialog (const char * title,
{
/* look for constructs like postgres://foo */
internal_name = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER (file_box));
if (internal_name != NULL)
{
if (strstr (internal_name, "file://") == internal_name)
{
/* nope, a local file name */
@ -181,6 +183,7 @@ gnc_file_dialog (const char * title,
}
file_name = g_strdup(internal_name);
}
}
gtk_widget_destroy(GTK_WIDGET(file_box));
LEAVE("%s", file_name ? file_name : "(null)");
return file_name;