[gnome-photos/gnome-3-24] utils: Avoid CRITICALs from the search provider for missing thumbnails
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-photos/gnome-3-24] utils: Avoid CRITICALs from the search provider for missing thumbnails
- Date: Fri, 8 Dec 2017 18:51:33 +0000 (UTC)
commit 26f410c805f828b884ac69cd2763fe35935ce0f8
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 17d6a8d..6830555 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]