1
0
gnome-control-center/gnome-control-center-crash-when-date-unavailable.patch

30 lines
1019 B
Diff

From 57aab756e9d67d6420bcb651537e45930a257aa2 Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 20 Oct 2014 13:41:21 +0200
Subject: background: Fix possible crash when date isn't available
https://bugzilla.gnome.org/show_bug.cgi?id=736475
diff --git a/panels/background/bg-pictures-source.c b/panels/background/bg-pictures-source.c
index c165fa3..1dcce19 100644
--- a/panels/background/bg-pictures-source.c
+++ b/panels/background/bg-pictures-source.c
@@ -571,7 +571,12 @@ add_single_file_from_media (BgPicturesSource *bg_source,
* plugin, GRL_METADATA_KEY_MODIFICATION_DATE is not
*/
mtime = grl_media_get_creation_date (media);
- mtime_unix = g_date_time_to_unix (mtime);
+ if (!mtime)
+ mtime = grl_media_get_modification_date (media);
+ if (mtime)
+ mtime_unix = g_date_time_to_unix (mtime);
+ else
+ mtime_unix = g_get_real_time () / G_USEC_PER_SEC;
return add_single_file (bg_source, file, content_type, (guint64) mtime_unix, NULL);
}
--
cgit v0.10.1