plugins/jabber/jabber.c

changeset 1624
73c1dbcbbcf9
parent 1611
4f0728d762eb
child 1642
74466b4b2cf8
--- 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)

mercurial