[recipes] Avoid a critical



commit 0168c0fbaf19dbe23890645bdb01a3a099579f07
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Apr 30 08:29:47 2017 -0400

    Avoid a critical
    
    We were not taking into account that the file may not exist.

 src/gr-recipe-store.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/gr-recipe-store.c b/src/gr-recipe-store.c
index 2bc77c0..ec5682a 100644
--- a/src/gr-recipe-store.c
+++ b/src/gr-recipe-store.c
@@ -974,13 +974,14 @@ set_modified_request (SoupMessage *msg,
                                   NULL,
                                   NULL);
 
-        g_file_info_get_modification_time (info, &tv);
-        mtime = g_date_time_new_from_timeval_utc (&tv);
-        mod_date = g_date_time_format (mtime, "%a, %d %b %Y %H:%M:%S %Z");
-        soup_message_headers_append (msg->request_headers, "If-Modified-Since", mod_date);
+        if (info) {
+                g_file_info_get_modification_time (info, &tv);
+                mtime = g_date_time_new_from_timeval_utc (&tv);
+                mod_date = g_date_time_format (mtime, "%a, %d %b %Y %H:%M:%S %Z");
+                soup_message_headers_append (msg->request_headers, "If-Modified-Since", mod_date);
+        }
 }
 
-
 static void
 update_file_timestamp (const char *path)
 {


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