]> spindle.queued.net Git - midori/commitdiff
Only encode and insert images of existing thumbnails
authorPaweł Forysiuk <tuxator@o2.pl>
Wed, 23 Mar 2011 21:32:49 +0000 (22:32 +0100)
committerChristian Dywan <christian@twotoasts.de>
Wed, 23 Mar 2011 21:32:49 +0000 (22:32 +0100)
midori/midori-view.c

index 1175e23812f1e125b9690608c94b2084c75a26a4..162a8a0566026959716539556b1c582d2b238b6e 100644 (file)
@@ -3829,10 +3829,17 @@ prepare_speed_dial_html (MidoriView* view)
             gchar* encoded;
             gchar* thumb_content;
 
-            g_file_get_contents (thumb_file, &thumb_content, &sz, NULL);
-            encoded = g_base64_encode ((guchar*)thumb_content, sz);
-            g_free  (thumb_file);
-            g_free (thumb_content);
+            if (g_access (thumb_file, F_OK) == 0)
+            {
+                g_file_get_contents (thumb_file, &thumb_content, &sz, NULL);
+                encoded = g_base64_encode ((guchar*)thumb_content, sz);
+                g_free (thumb_file);
+                g_free (thumb_content);
+            }
+            else
+            {
+                encoded = "";
+            }
             g_free (slot_id);
 
             g_string_append_printf (markup,