mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
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:
parent
ad1ba56105
commit
ad208810f0
@ -174,12 +174,15 @@ gnc_file_dialog (const char * title,
|
|||||||
{
|
{
|
||||||
/* look for constructs like postgres://foo */
|
/* look for constructs like postgres://foo */
|
||||||
internal_name = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER (file_box));
|
internal_name = gtk_file_chooser_get_uri(GTK_FILE_CHOOSER (file_box));
|
||||||
if (strstr (internal_name, "file://") == internal_name)
|
if (internal_name != NULL)
|
||||||
{
|
{
|
||||||
/* nope, a local file name */
|
if (strstr (internal_name, "file://") == internal_name)
|
||||||
internal_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (file_box));
|
{
|
||||||
|
/* nope, a local file name */
|
||||||
|
internal_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (file_box));
|
||||||
|
}
|
||||||
|
file_name = g_strdup(internal_name);
|
||||||
}
|
}
|
||||||
file_name = g_strdup(internal_name);
|
|
||||||
}
|
}
|
||||||
gtk_widget_destroy(GTK_WIDGET(file_box));
|
gtk_widget_destroy(GTK_WIDGET(file_box));
|
||||||
LEAVE("%s", file_name ? file_name : "(null)");
|
LEAVE("%s", file_name ? file_name : "(null)");
|
||||||
|
Loading…
Reference in New Issue
Block a user