gnucash maint: Bug 773808 - Export Report Crash

John Ralls jralls at code.gnucash.org
Sun Dec 11 13:01:27 EST 2016


Updated	 via  https://github.com/Gnucash/gnucash/commit/ad208810 (commit)
	from  https://github.com/Gnucash/gnucash/commit/ad1ba561 (commit)



commit ad208810f0313f111529e1605f72adf32b68b57f
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Dec 11 09:58:54 2016 -0800

    Bug 773808 - Export Report Crash
    
    It's possible for the GtkFileChooserDialog to return a NULL filename,
    so defend against that.

diff --git a/src/gnome-utils/gnc-file.c b/src/gnome-utils/gnc-file.c
index ed01fa9..2e61c9a 100644
--- a/src/gnome-utils/gnc-file.c
+++ b/src/gnome-utils/gnc-file.c
@@ -174,12 +174,15 @@ 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 (strstr (internal_name, "file://") == internal_name)
+        if (internal_name != NULL)
         {
-            /* nope, a local file name */
-            internal_name = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER (file_box));
+            if (strstr (internal_name, "file://") == internal_name)
+            {
+                /* 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));
     LEAVE("%s", file_name ? file_name : "(null)");



Summary of changes:
 src/gnome-utils/gnc-file.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list