diff options
author | Colomban Wendling <[email protected]> | 2025-06-25 11:29:04 +0200 |
---|---|---|
committer | Colomban Wendling <[email protected]> | 2025-06-25 11:29:04 +0200 |
commit | 492b20b5e1ebe7f2eb99c87f998d41f9df35b87d (patch) | |
tree | 8d446909bc4d26307227a061fc27fe203ad67a98 /src/dlg-prop.c | |
parent | bfad4da5b243c6353b21e499813c0a80790d3f98 (diff) | |
download | engrampa-datetime-failure.tar.bz2 engrampa-datetime-failure.tar.xz |
Avoid critical errors with invalid datesdatetime-failure
This likely should not happen with valid dates, but can if a archiver
reports invalid ones for whatever reason (legitimate weird dates, or
parser failures for example).
Diffstat (limited to 'src/dlg-prop.c')
-rw-r--r-- | src/dlg-prop.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/dlg-prop.c b/src/dlg-prop.c index cb8ed87..e82d5f1 100644 --- a/src/dlg-prop.c +++ b/src/dlg-prop.c @@ -101,10 +101,12 @@ dlg_prop (FrWindow *window) GDateTime *date_time; date_time = g_date_time_new_from_unix_local (get_file_mtime (fr_window_get_archive_uri (window))); - s = g_date_time_format (date_time, _("%d %B %Y, %H:%M")); - g_date_time_unref (date_time); - gtk_label_set_text (GET_LABEL ("p_date_label"), s); - g_free (s); + if (date_time) { + s = g_date_time_format (date_time, _("%d %B %Y, %H:%M")); + g_date_time_unref (date_time); + gtk_label_set_text (GET_LABEL ("p_date_label"), s); + g_free (s); + } /**/ |