# HG changeset patch # User Elliott Sales de Andrade # Date 1667025474 18000 # Node ID 9315e777278076478d7b389c0a6c81168ef024a4 # Parent ed82ab63d15abc7a6941048e0bbf0b9f4ce13e99 Fix criticals when opening Add a Chat dialog Testing Done: Opened Add a Chat dialog with `G_DEBUG=fatal-criticals` and didn't crash. Reviewed at https://reviews.imfreedom.org/r/1999/ diff -r ed82ab63d15a -r 9315e7772780 pidgin/pidginaddchatdialog.c --- a/pidgin/pidginaddchatdialog.c Sat Oct 29 01:14:13 2022 -0500 +++ b/pidgin/pidginaddchatdialog.c Sat Oct 29 01:37:54 2022 -0500 @@ -100,16 +100,19 @@ GHashTable *defaults = NULL; gboolean focus_set = FALSE; - account = pidgin_account_chooser_get_selected(PIDGIN_ACCOUNT_CHOOSER(dialog->account)); - connection = purple_account_get_connection(account); - protocol = purple_account_get_protocol(account); - /* Clean up the dynamic box and our list of entires. */ while((child = gtk_widget_get_first_child(dialog->dynamic_box)) != NULL) { gtk_box_remove(GTK_BOX(dialog->dynamic_box), child); } g_clear_pointer(&dialog->inputs, g_list_free); + account = pidgin_account_chooser_get_selected(PIDGIN_ACCOUNT_CHOOSER(dialog->account)); + if(!PURPLE_IS_ACCOUNT(account)) { + return; + } + + connection = purple_account_get_connection(account); + protocol = purple_account_get_protocol(account); info = purple_protocol_chat_info(PURPLE_PROTOCOL_CHAT(protocol), connection); defaults = purple_protocol_chat_info_defaults(PURPLE_PROTOCOL_CHAT(protocol),