- 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);
+ }