From b75230fcd89e0dc054e8744cbdc1d3fdbd1c3542 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Wed, 25 Feb 2004 21:11:48 +0000 Subject: Protect against using NULL pixbufs. Gets rid of a lot of console warning 2004-02-25 Jeffrey Stedfast * 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 --- mail/ChangeLog | 6 +++++- mail/em-format-html-display.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/mail/ChangeLog b/mail/ChangeLog index ec87d244bb..3f1a34db6e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,9 +1,13 @@ 2004-02-25 Jeffrey Stedfast + * 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. + * em-folder-view.c (emfv_list_key_press): Removed Delete/KP_Delete from here. Now handled via the bonobo-ui menu accels. Fixes bug #53504. -2004-02-25 +2004-02-25 Radek Doulik * mail-session.c (main_get_filter_driver): set seen flag for junk messages 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; -- cgit v1.2.3