changeset 1624:12bd198b6721

[gaim-migrate @ 1634] fixes committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 21 Mar 2001 03:25:57 +0000
parents 8684c0315818
children 8c92ea5d854f
files plugins/jabber/jabber.c
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/jabber/jabber.c	Tue Mar 20 20:10:33 2001 +0000
+++ b/plugins/jabber/jabber.c	Wed Mar 21 03:25:57 2001 +0000
@@ -615,8 +615,10 @@
 			}
 
 		if (type && (strcasecmp(type, "unavailable") == 0)) {
-			g_free(resources->data);
-			b->proto_data = g_slist_remove(b->proto_data, resources->data);
+			if (resources) {
+				g_free(resources->data);
+				b->proto_data = g_slist_remove(b->proto_data, resources->data);
+			}
 			if (!b->proto_data) {
 				serv_got_update(GJ_GC(j), buddy, 0, 0, 0, 0, 0, 0);
 			}
@@ -863,7 +865,9 @@
 	gjab_packet_handler(jd->jc, jabber_handlepacket);
 	gjab_start(jd->jc);
 
-	gc->inpa = gdk_input_add(jd->jc->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, jabber_callback, gc);
+	if (gc->proto_data)
+		gc->inpa = gdk_input_add(jd->jc->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
+				jabber_callback, gc);
 
 	return;
 }
@@ -874,6 +878,7 @@
 	gdk_input_remove(gc->inpa);
 	gjab_stop(jd->jc);
 	g_free(jd);
+	gc->proto_data = NULL;
 }
 
 static void jabber_send_im(struct gaim_connection *gc, char *who, char *message, int away)