X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/61011e917fe6e144d18f39c58dabb34476efaa83..90254df808aa4261e414ebacbb1417f87fad3bc9:/src/gtk/assertdlg_gtk.c?ds=sidebyside diff --git a/src/gtk/assertdlg_gtk.c b/src/gtk/assertdlg_gtk.c index 85c4666b42..5355e8b2f2 100644 --- a/src/gtk/assertdlg_gtk.c +++ b/src/gtk/assertdlg_gtk.c @@ -181,18 +181,23 @@ void gtk_assert_dialog_save_backtrace_callback (GtkWidget *widget, GtkAssertDial FILE *fp; filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); - msg = gtk_assert_dialog_get_message (dlg); - backtrace = gtk_assert_dialog_get_backtrace (dlg); - - /* open the file and write all info inside it */ - fp = fopen (filename, "w"); - if (fp) - fprintf (fp, "ASSERT INFO:\n%s\n\nBACKTRACE:\n%s", msg, backtrace); - - g_free (filename); - g_free (msg); - g_free (backtrace); - fclose (fp); + if ( filename ) + { + msg = gtk_assert_dialog_get_message (dlg); + backtrace = gtk_assert_dialog_get_backtrace (dlg); + + /* open the file and write all info inside it */ + fp = fopen (filename, "w"); + if (fp) + { + fprintf (fp, "ASSERT INFO:\n%s\n\nBACKTRACE:\n%s", msg, backtrace); + fclose (fp); + } + + g_free (filename); + g_free (msg); + g_free (backtrace); + } } gtk_widget_destroy (dialog);