diff options
author | Jeffrey Stedfast <fejj@ximian.com> | 2004-02-26 05:11:48 +0800 |
---|---|---|
committer | Jeffrey Stedfast <fejj@src.gnome.org> | 2004-02-26 05:11:48 +0800 |
commit | b75230fcd89e0dc054e8744cbdc1d3fdbd1c3542 (patch) | |
tree | a5430a6bb0e3c0e3fd85e9fbe5eaacf369dc9fed /mail/em-format-html-display.c | |
parent | 6db6379e350eb77cd0b099bc97c43dee1a869ce3 (diff) | |
download | gsoc2013-evolution-b75230fcd89e0dc054e8744cbdc1d3fdbd1c3542.tar.gz gsoc2013-evolution-b75230fcd89e0dc054e8744cbdc1d3fdbd1c3542.tar.zst gsoc2013-evolution-b75230fcd89e0dc054e8744cbdc1d3fdbd1c3542.zip |
Protect against using NULL pixbufs. Gets rid of a lot of console warning
2004-02-25 Jeffrey Stedfast <fejj@ximian.com>
* em-format-html-display.c (efhd_attachment_button): Protect
against using NULL pixbufs. Gets rid of a lot of console warning
spewage on my system.
svn path=/trunk/; revision=24873
Diffstat (limited to 'mail/em-format-html-display.c')
-rw-r--r-- | mail/em-format-html-display.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index d96259476e..5ca371c0dd 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -1256,12 +1256,15 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje em_format_html_job_queue(efh, job); } } else { - GdkPixbuf *pixbuf = e_icon_for_mime_type(simple_type, 24); - GdkPixbuf *mini = gdk_pixbuf_scale_simple(pixbuf, 24, 24, GDK_INTERP_BILINEAR); - - gtk_image_set_from_pixbuf((GtkImage *)w, mini); - g_object_unref(mini); - g_object_unref(pixbuf); + GdkPixbuf *pixbuf, *mini; + + if ((pixbuf = e_icon_for_mime_type (simple_type, 24))) { + if ((mini = gdk_pixbuf_scale_simple (pixbuf, 24, 24, GDK_INTERP_BILINEAR))) { + gtk_image_set_from_pixbuf ((GtkImage *) w, mini); + g_object_unref (mini); + } + g_object_unref (pixbuf); + } } drag_types[0].target = simple_type; |