app-tools, app: gimp-debug-tool crashing with NULL release_date.

The crash dialog was failing to be created when using the last version
of GIMP!
This commit is contained in:
Jehan 2020-03-27 19:44:41 +01:00
parent dd705e21c0
commit d76c8e8cc3
2 changed files with 10 additions and 6 deletions

View File

@ -85,7 +85,7 @@ main (int argc,
gtk_init (&argc, &argv);
dialog = gimp_critical_dialog_new (_("GIMP Crash Debug"), last_version,
g_ascii_strtoll (release_date, NULL, 10));
release_date ? g_ascii_strtoll (release_date, NULL, 10) : -1);
gimp_critical_dialog_add (dialog, error, trace, TRUE, program,
g_ascii_strtoull (pid, NULL, 10));
g_free (error);

View File

@ -501,14 +501,18 @@ gimp_critical_dialog_new (const gchar *title,
gint64 release_timestamp)
{
GtkWidget *dialog;
GDateTime *datetime;
gchar *date;
gchar *date = NULL;
g_return_val_if_fail (title != NULL, NULL);
datetime = g_date_time_new_from_unix_local (release_timestamp);
date = g_date_time_format (datetime, "%x");
g_date_time_unref (datetime);
if (release_timestamp > 0)
{
GDateTime *datetime;
datetime = g_date_time_new_from_unix_local (release_timestamp);
date = g_date_time_format (datetime, "%x");
g_date_time_unref (datetime);
}
dialog = g_object_new (GIMP_TYPE_CRITICAL_DIALOG,
"title", title,