diff src/gtkpounce.c @ 5161:777f56b95a92

[gaim-migrate @ 5525] Less evil still. committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Fri, 18 Apr 2003 03:26:42 +0000
parents 67a72f9fede8
children fefad67de2c7
line wrap: on
line diff
--- a/src/gtkpounce.c	Fri Apr 18 02:28:06 2003 +0000
+++ b/src/gtkpounce.c	Fri Apr 18 03:26:42 2003 +0000
@@ -737,22 +737,24 @@
 		pounce = (struct gaim_pounce *)bp->data;
 		buddy = gaim_pounce_get_pouncee(pounce);
 
+		/* Build the menu item */
+		item = gtk_image_menu_item_new_with_label(buddy);
+
 		/* Create a pixmap for the protocol icon. */
 		pixbuf = create_prpl_icon(gaim_pounce_get_pouncer(pounce));
-		scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
+		if(pixbuf) {
+			scale = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
+					GDK_INTERP_BILINEAR);
 
-		/* Now convert it to GtkImage */
-		if (pixbuf == NULL)
-			image = gtk_image_new();
-		else
+			/* Now convert it to GtkImage */
 			image = gtk_image_new_from_pixbuf(scale);
-
-		g_object_unref(G_OBJECT(scale));
-		g_object_unref(G_OBJECT(pixbuf));
+			g_object_unref(G_OBJECT(scale));
+			g_object_unref(G_OBJECT(pixbuf));
+			gtk_widget_show(image);
+			gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+		}
 
-		/* Build the menu item */
-		item = gtk_image_menu_item_new_with_label(buddy);
-		gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(item), image);
+		/* Put the item in the menu */
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 		gtk_widget_show(item);