summaryrefslogtreecommitdiff
path: root/libcaja-private/caja-file.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-09-22 15:01:18 +0200
committerStefano Karapetsas <[email protected]>2013-09-22 15:02:45 +0200
commitc79f320aba836847f35e5e465754b1ddd62806b4 (patch)
tree0271c406b160349ae36ca68bf826020bf40dc5bc /libcaja-private/caja-file.c
parent47ac58d285ef6cd6076a54a3d2f12cb3208f8c36 (diff)
downloadcaja-c79f320aba836847f35e5e465754b1ddd62806b4.tar.bz2
caja-c79f320aba836847f35e5e465754b1ddd62806b4.tar.xz
Add check if mimetype is null before apply thumbnail frame
To avoid segfaults on file deletions
Diffstat (limited to 'libcaja-private/caja-file.c')
-rw-r--r--libcaja-private/caja-file.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libcaja-private/caja-file.c b/libcaja-private/caja-file.c
index 85f8a9ce..fa00ac8c 100644
--- a/libcaja-private/caja-file.c
+++ b/libcaja-private/caja-file.c
@@ -4324,12 +4324,13 @@ caja_file_get_icon (CajaFile *file,
/* Render frames only for thumbnails of non-image files
and for images with no alpha channel. */
- gboolean is_image = strncmp(eel_ref_str_peek (file->details->mime_type), "image/", 6) == 0;
- if (!is_image ||
- is_image && !gdk_pixbuf_get_has_alpha (raw_pixbuf)) {
- caja_ui_frame_image (&scaled_pixbuf);
- }
-
+ gboolean is_image = file->details->mime_type &&
+ (strncmp(eel_ref_str_peek (file->details->mime_type), "image/", 6) == 0);
+ if (!is_image ||
+ is_image && !gdk_pixbuf_get_has_alpha (raw_pixbuf)) {
+ caja_ui_frame_image (&scaled_pixbuf);
+ }
+
g_object_unref (raw_pixbuf);
/* Don't scale up if more than 25%, then read the original