[gaim-migrate @ 13792]

Wed, 14 Sep 2005 01:18:07 +0000

author
Daniel Atallah <datallah@pidgin.im>
date
Wed, 14 Sep 2005 01:18:07 +0000
changeset 11538
d87f3717d5a5
parent 11537
1628dff8c1ea
child 11539
fbabe3f89777

[gaim-migrate @ 13792]
Don't crash if logging out while connecting

src/protocols/gg/gg.c file | annotate | diff | comparison | revisions
--- a/src/protocols/gg/gg.c	Wed Sep 14 01:15:28 2005 +0000
+++ b/src/protocols/gg/gg.c	Wed Sep 14 01:18:07 2005 +0000
@@ -1174,24 +1174,25 @@
 /* static void ggp_close(GaimConnection *gc) {{{ */
 static void ggp_close(GaimConnection *gc)
 {
-	GGPInfo *info;
 
 	if (gc == NULL) {
 		gaim_debug_info("gg", "gc == NULL\n");
 		return;
 	}
 
-	info = gc->proto_data;
-
-	/* XXX: Any way to pass description here? */
-	if (info->session != NULL)
-		gg_change_status(info->session, GG_STATUS_NOT_AVAIL);
+	if (gc->proto_data) {
+		GGPInfo *info = gc->proto_data;
+		/* XXX: Any way to pass description here? */
+		if (info->session != NULL) {
+			gg_change_status(info->session, GG_STATUS_NOT_AVAIL);
+			gg_logoff(info->session);
+			gg_free_session(info->session);
+		}
+	}
 
 	if (gc->inpa > 0)
 		gaim_input_remove(gc->inpa);
 
-	gg_logoff(info->session);
-	gg_free_session(info->session);
 	ggp_buddylist_offline(gc);
 
 	gaim_debug_info("gg", "Connection closed.\n");

mercurial