changeset 14134:4006d3dc2871

[gaim-migrate @ 16776] Fix segfault when using non-buddy-icon'ed accounts committer: Tailor Script <tailor@pidgin.im>
author Sean Egan <seanegan@gmail.com>
date Wed, 16 Aug 2006 01:32:12 +0000
parents 31d33e7bc0e6
children 38270d4e29c6
files src/gtkstatusbox.c src/gtkutils.c
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkstatusbox.c	Tue Aug 15 23:25:29 2006 +0000
+++ b/src/gtkstatusbox.c	Wed Aug 16 01:32:12 2006 +0000
@@ -926,7 +926,8 @@
 		GList *accounts;
 		for (accounts = gaim_accounts_get_all(); accounts != NULL; accounts = accounts->next) {
 			GaimAccount *account = accounts->data;
-			if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddy-icon", TRUE)) {
+			if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddy-icon", TRUE) &&
+			    GAIM_PLUGIN_PROTOCOL_INFO(gaim_find_prpl(gaim_account_get_protocol_id(account)))->icon_spec.format) {
 				char *icon = gaim_gtk_convert_buddy_icon(gaim_find_prpl(gaim_account_get_protocol_id(account)),
 									 filename);
 				gaim_account_set_buddy_icon(account, icon);
--- a/src/gtkutils.c	Tue Aug 15 23:25:29 2006 +0000
+++ b/src/gtkutils.c	Wed Aug 16 01:32:12 2006 +0000
@@ -2457,6 +2457,8 @@
 char*
 gaim_gtk_convert_buddy_icon(GaimPlugin *plugin, const char *path)
 {
+	g_return_val_if_fail(GAIM_PLUGIN_PROTOCOL_INFO(plugin)->icon_spec.format != NULL, NULL);
+
 #if GTK_CHECK_VERSION(2,2,0)
 	int width, height;
 	char **pixbuf_formats = NULL;