pidgin: b8ae7461: Fix a crash that happens when accessing ...

rekkanoryo at pidgin.im rekkanoryo at pidgin.im
Sat Dec 6 00:20:37 EST 2008


-----------------------------------------------------------------
Revision: b8ae746191c0e1038817be7add185cdc01f65c47
Ancestor: 4e0cf1c28c6c278bc23f23553b06a6980e2a1413
Author: paul at aurich.com
Date: 2008-12-06T05:14:07
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b8ae746191c0e1038817be7add185cdc01f65c47

Modified files:
        finch/gntroomlist.c libpurple/roomlist.c
        pidgin/gtkroomlist.c

ChangeLog: 

Fix a crash that happens when accessing the roomlist for an account that's
not connected.  Fixes #7707.

-------------- next part --------------
============================================================
--- finch/gntroomlist.c	b95a84030822eb9b3082af8a41a6a10b9a4a0a0f
+++ finch/gntroomlist.c	1c686ba3a994a1885115ca43621d246a25b3dc51
@@ -239,7 +239,8 @@ reset_account_list(PurpleAccount *accoun
 		PurpleConnection *gc = list->data;
 
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(purple_connection_get_prpl(gc));
-		if (prpl_info->roomlist_get_list != NULL) {
+		if (PURPLE_CONNECTION_IS_CONNECTED(gc) &&
+		        prpl_info->roomlist_get_list != NULL) {
 			PurpleAccount *account = purple_connection_get_account(gc);
 			char *text = g_strdup_printf("%s (%s)",
 					purple_account_get_username(account),
============================================================
--- libpurple/roomlist.c	f47bcbcbdd78502b0140d8108256086583c4379e
+++ libpurple/roomlist.c	c01e0a6a6ae18750b712cea63afbe192476b5eea
@@ -173,6 +173,7 @@ PurpleRoomlist *purple_roomlist_get_list
 	PurplePluginProtocolInfo *prpl_info = NULL;
 
 	g_return_val_if_fail(gc != NULL, NULL);
+	g_return_val_if_fail(PURPLE_CONNECTION_IS_CONNECTED(gc), NULL);
 
 	prpl = purple_connection_get_prpl(gc);
 
============================================================
--- pidgin/gtkroomlist.c	3829fbf07b00792ee32ae84e02acc141b30e35b9
+++ pidgin/gtkroomlist.c	f61b4ce6297b0c399a05a19ef431c55cb1f48eda
@@ -488,7 +488,7 @@ static gboolean account_filter_func(Purp
 	PurpleConnection *conn = purple_account_get_connection(account);
 	PurplePluginProtocolInfo *prpl_info = NULL;
 
-	if (conn)
+	if (conn && PURPLE_CONNECTION_IS_CONNECTED(conn))
 		prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(conn->prpl);
 
 	return (prpl_info && prpl_info->roomlist_get_list != NULL);


More information about the Commits mailing list