[gnome-control-center] background: Fix possible crash when date isn't available



commit 57aab756e9d67d6420bcb651537e45930a257aa2
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Oct 20 13:41:21 2014 +0200

    background: Fix possible crash when date isn't available
    
    https://bugzilla.gnome.org/show_bug.cgi?id=736475

 panels/background/bg-pictures-source.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
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);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]