Wed, 16 Aug 2006 01:32:12 +0000
[gaim-migrate @ 16776]
Fix segfault when using non-buddy-icon'ed accounts
| src/gtkstatusbox.c | file | annotate | diff | comparison | revisions | |
| src/gtkutils.c | file | annotate | diff | comparison | revisions |
--- 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;