changeset 6839:bdc4e73f354d

[gaim-migrate @ 7384] Fixed a smiley crash. Thanks javabsp. committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 14 Sep 2003 21:08:56 +0000
parents 551a8111977a
children b67670ac5584
files src/gtkimhtml.c
diffstat 1 files changed, 5 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkimhtml.c	Sun Sep 14 21:06:32 2003 +0000
+++ b/src/gtkimhtml.c	Sun Sep 14 21:08:56 2003 +0000
@@ -1385,10 +1385,11 @@
 			wpos = g_snprintf (ws, smilelen + 1, "%s", c);
 			anchor = gtk_text_buffer_create_child_anchor(imhtml->text_buffer, &iter);
 			pixbuf = gtk_smiley_tree_image(imhtml, sml, ws);
-			icon = gtk_image_new_from_animation(pixbuf);
-			g_object_unref(pixbuf);
-			gtk_widget_show(icon);
-			gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor);
+			if(pixbuf){
+				icon = gtk_image_new_from_animation(pixbuf);
+				gtk_widget_show(icon);
+				gtk_text_view_add_child_at_anchor(GTK_TEXT_VIEW(imhtml), icon, anchor);
+			}
 
 			c += smilelen;
 			pos += smilelen;