Mercurial > pidgin.yaz
changeset 14155:47292c1f7e9f
[gaim-migrate @ 16800]
segfault fix
committer: Tailor Script <tailor@pidgin.im>
author | Sean Egan <seanegan@gmail.com> |
---|---|
date | Wed, 16 Aug 2006 20:50:16 +0000 |
parents | c55e46e26781 |
children | 0154168c414a |
files | src/gtkstatusbox.c |
diffstat | 1 files changed, 17 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/src/gtkstatusbox.c Wed Aug 16 19:38:57 2006 +0000 +++ b/src/gtkstatusbox.c Wed Aug 16 20:50:16 2006 +0000 @@ -998,23 +998,28 @@ if (box->account) { GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(box->account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (prplinfo->icon_spec.format) { - char *icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_buddy_icon(box->account, icon); - g_free(icon); - gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo && prplinfo->icon_spec.format) { + char *icon = gaim_gtk_convert_buddy_icon(plug, filename); + gaim_account_set_buddy_icon(box->account, icon); + g_free(icon); + gaim_account_set_ui_bool(box->account, GAIM_GTK_UI, "use-global-buddyicon", FALSE); + } } } else { for (accounts = gaim_accounts_get_all(); accounts != NULL; accounts = accounts->next) { GaimAccount *account = accounts->data; GaimPlugin *plug = gaim_find_prpl(gaim_account_get_protocol_id(account)); - GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); - if (gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && - prplinfo->icon_spec.format) { - char *icon = gaim_gtk_convert_buddy_icon(plug, filename); - gaim_account_set_buddy_icon(account, icon); - g_free(icon); + if (plug) { + GaimPluginProtocolInfo *prplinfo = GAIM_PLUGIN_PROTOCOL_INFO(plug); + if (prplinfo != NULL && + gaim_account_get_ui_bool(account, GAIM_GTK_UI, "use-global-buddyicon", TRUE) && + prplinfo->icon_spec.format) { + char *icon = gaim_gtk_convert_buddy_icon(plug, filename); + gaim_account_set_buddy_icon(account, icon); + g_free(icon); + } } } }