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



commit a3243dd33a1a2f3d77a0e84f277efa294bfa2647
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 0607505..b9cd05c 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -457,6 +457,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]