Fix Test for filepath is NULL when cancel pressed for export

This commit is contained in:
Robert Fewell
2017-12-30 17:15:03 +00:00
parent 19e0f58763
commit bde39c527c

View File

@@ -1537,10 +1537,12 @@ gnc_get_export_filename (SCM choice)
filepath = gnc_file_dialog (gnc_ui_get_main_window (NULL),
title, NULL, default_dir, GNC_FILE_DIALOG_EXPORT);
/* Try to test for extension on file name, add if missing */
if (g_strrstr(filepath, ".") == NULL)
filepath = g_strconcat(filepath, ".", g_ascii_strdown(type, strlen(type)), NULL);
if (filepath != NULL) // test for cancel pressed
{
/* Try to test for extension on file name, add if missing */
if (g_strrstr(filepath, ".") == NULL)
filepath = g_strconcat(filepath, ".", g_ascii_strdown(type, strlen(type)), NULL);
}
g_free (type);
g_free (title);
g_free (default_dir);