changeset 21536:fd101c75472f

Fix #3911 by checking that the connection is still valid when authorizing or denying an MSN auth. request.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 16 Nov 2007 01:39:53 +0000
parents e8d80d18df30
children 9dbf38f270da
files libpurple/protocols/msnp9/userlist.c
diffstat 1 files changed, 16 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msnp9/userlist.c	Fri Nov 16 01:19:52 2007 +0000
+++ b/libpurple/protocols/msnp9/userlist.c	Fri Nov 16 01:39:53 2007 +0000
@@ -41,10 +41,15 @@
 msn_accept_add_cb(gpointer data)
 {
 	MsnPermitAdd *pa = data;
-	MsnSession *session = pa->gc->proto_data;
-	MsnUserList *userlist = session->userlist;
+	MsnSession *session;
+	MsnUserList *userlist;
 
-	msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_AL, NULL);
+	if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+		session = pa->gc->proto_data;
+		userlist = session->userlist;
+
+		msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_AL, NULL);
+	}
 
 	g_free(pa->who);
 	g_free(pa->friendly);
@@ -55,10 +60,15 @@
 msn_cancel_add_cb(gpointer data)
 {
 	MsnPermitAdd *pa = data;
-	MsnSession *session = pa->gc->proto_data;
-	MsnUserList *userlist = session->userlist;
+	MsnSession *session;
+	MsnUserList *userlist;
 
-	msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_BL, NULL);
+	if (PURPLE_CONNECTION_IS_VALID(pa->gc)) {
+		session = pa->gc->proto_data;
+		userlist = session->userlist;
+
+		msn_userlist_add_buddy(userlist, pa->who, MSN_LIST_BL, NULL);
+	}
 
 	g_free(pa->who);
 	g_free(pa->friendly);