# HG changeset patch # User Daniel Atallah # Date 1155872978 0 # Node ID 27ead1cf6dcbc4406630d733f1586376961d8811 # Parent 6dd5b199a400542d3e48c0c1ec00a4b292bbdafd [gaim-migrate @ 16826] Fix asserts at startup. committer: Tailor Script diff -r 6dd5b199a400 -r 27ead1cf6dcb src/gtkstatusbox.c --- a/src/gtkstatusbox.c Fri Aug 18 02:24:39 2006 +0000 +++ b/src/gtkstatusbox.c Fri Aug 18 03:49:38 2006 +0000 @@ -1280,10 +1280,12 @@ { scaled = gdk_pixbuf_new_from_file_at_scale(status_box->buddy_icon_path, icon_alc.height, icon_alc.width, FALSE, NULL); - g_object_unref(status_box->buddy_icon_hover); + 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); - g_object_unref(status_box->buddy_icon); + 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); } @@ -1444,14 +1446,18 @@ { if (box->buddy_icon != NULL) g_object_unref(box->buddy_icon); - scaled = gdk_pixbuf_new_from_file_at_scale(filename, - box->icon_size, box->icon_size, FALSE, NULL); - if (scaled != NULL) - { - box->buddy_icon_hover = gdk_pixbuf_copy(scaled); - do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); - box->buddy_icon = scaled; - gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + + /* This will get called before the box is shown and will not have a size */ + if (box->icon_size > 0) { + scaled = gdk_pixbuf_new_from_file_at_scale(filename, + box->icon_size, box->icon_size, FALSE, NULL); + if (scaled != NULL) + { + box->buddy_icon_hover = gdk_pixbuf_copy(scaled); + do_colorshift(box->buddy_icon_hover, box->buddy_icon_hover, 30); + box->buddy_icon = scaled; + gtk_image_set_from_pixbuf(GTK_IMAGE(box->icon), box->buddy_icon); + } } }