[gnome-photos/gnome-3-26] utils: Avoid CRITICALs from the search provider for missing thumbnails



commit 27af9b81bcc9e803d48a64f7ee7571c17e8b994b
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Dec 5 11:38:15 2017 +0100

    utils: Avoid CRITICALs from the search provider for missing thumbnails
    
    Just because photos_utils_file_query_info has succeeded it doesn't mean
    that a thumbnail is present. If it's absent, the path is NULL and it
    led to:
      GLib-GIO-CRITICAL **: g_file_new_for_path: assertion 'path != NULL'
        failed

 src/photos-utils.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 1c1c231..a9d8f13 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -418,6 +418,9 @@ photos_utils_get_thumbnail_icon (const gchar *uri)
     }
 
   thumb_path = g_file_info_get_attribute_byte_string (info, G_FILE_ATTRIBUTE_THUMBNAIL_PATH);
+  if (thumb_path == NULL)
+    goto out;
+
   thumb_file = g_file_new_for_path (thumb_path);
   icon = g_file_icon_new (thumb_file);
 


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