changeset 21602:53fee49ce1c5

Prevent crashing when authorizing or denying after the account is disconnected.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 21 Nov 2007 02:53:27 +0000
parents 7ec7feef1f5c
children a4b6854737d5
files libpurple/protocols/jabber/presence.c
diffstat 1 files changed, 6 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/presence.c	Wed Nov 21 02:26:23 2007 +0000
+++ b/libpurple/protocols/jabber/presence.c	Wed Nov 21 02:53:27 2007 +0000
@@ -308,8 +308,9 @@
 static void authorize_add_cb(gpointer data)
 {
 	struct _jabber_add_permit *jap = data;
-	jabber_presence_subscription_set(jap->gc->proto_data, jap->who,
-			"subscribed");
+	if(PURPLE_CONNECTION_IS_VALID(jap->gc))
+		jabber_presence_subscription_set(jap->gc->proto_data,
+			jap->who, "subscribed");
 	g_free(jap->who);
 	g_free(jap);
 }
@@ -317,9 +318,9 @@
 static void deny_add_cb(gpointer data)
 {
 	struct _jabber_add_permit *jap = data;
-	jabber_presence_subscription_set(jap->gc->proto_data, jap->who,
-			"unsubscribed");
-
+	if(PURPLE_CONNECTION_IS_VALID(jap->gc))
+		jabber_presence_subscription_set(jap->gc->proto_data,
+			jap->who, "unsubscribed");
 	g_free(jap->who);
 	g_free(jap);
 }