# HG changeset patch # User John Bailey # Date 1230529038 0 # Node ID 2ce759d9176aa761bf3c41b4ddc00de8491ebcad # Parent 689cfb82242e4c995a969121a7a4b9806446e95a Make sure the prpl has a get_account_text_table function before trying to call it. Fixes #7918. diff -r 689cfb82242e -r 2ce759d9176a pidgin/gtkaccount.c --- a/pidgin/gtkaccount.c Sun Dec 28 00:39:39 2008 +0000 +++ b/pidgin/gtkaccount.c Mon Dec 29 05:37:18 2008 +0000 @@ -286,25 +286,27 @@ screenname_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) { GdkColor color = {0, 34952, 35466, 34181}; - GHashTable *table; - const char *label; - - table = dialog->prpl_info->get_account_text_table(NULL); - label = g_hash_table_lookup(table, "login_label"); - - if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { - /* We have to avoid hitting the screenname_changed_cb function - * because it enables buttons we don't want enabled yet ;) - */ - g_signal_handlers_block_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); - gtk_entry_set_text(GTK_ENTRY(widget), label); - /* Make sure we can hit it again */ - g_signal_handlers_unblock_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); - gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color); + GHashTable *table = NULL; + const char *label = NULL; + + if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) { + table = dialog->prpl_info->get_account_text_table(NULL); + label = g_hash_table_lookup(table, "login_label"); + + if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { + /* We have to avoid hitting the screenname_changed_cb function + * because it enables buttons we don't want enabled yet ;) + */ + g_signal_handlers_block_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); + gtk_entry_set_text(GTK_ENTRY(widget), label); + /* Make sure we can hit it again */ + g_signal_handlers_unblock_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); + gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color); + } + + g_hash_table_destroy(table); } - g_hash_table_destroy(table); - return FALSE; }