changeset 14178:00f4e261e5f0

[gaim-migrate @ 16828] Get rid of an assertion failure when the selected icon is not a valid image committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 18 Aug 2006 05:56:10 +0000
parents cdc1850eb4ab
children db2d55d332d6
files src/gtkstatusbox.c
diffstat 1 files changed, 11 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkstatusbox.c	Fri Aug 18 03:59:01 2006 +0000
+++ b/src/gtkstatusbox.c	Fri Aug 18 05:56:10 2006 +0000
@@ -1275,19 +1275,22 @@
 
 		if (status_box->icon_size != icon_alc.height)
 		{
+			if (status_box->buddy_icon_hover)
+				g_object_unref(status_box->buddy_icon_hover);
 			if ((status_box->buddy_icon_path != NULL) &&
 				(*status_box->buddy_icon_path != '\0'))
 			{
 				scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path,
 									   icon_alc.height, icon_alc.width, FALSE, NULL);
-				if (status_box->buddy_icon_hover)
-					g_object_unref(status_box->buddy_icon_hover);
-				status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled);
-				do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30);
-				if (status_box->buddy_icon)
-					g_object_unref(status_box->buddy_icon);
-				status_box->buddy_icon = scaled;
-				gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon);
+				if (scaled != NULL)
+				{
+					status_box->buddy_icon_hover = gdk_pixbuf_copy(scaled);
+					do_colorshift(status_box->buddy_icon_hover, status_box->buddy_icon_hover, 30);
+					if (status_box->buddy_icon)
+						g_object_unref(status_box->buddy_icon);
+					status_box->buddy_icon = scaled;
+					gtk_image_set_from_pixbuf(GTK_IMAGE(status_box->icon), status_box->buddy_icon);
+				}
 			}
 			status_box->icon_size = icon_alc.height;
 		}