changeset 15356:00d0d4524377

[gaim-migrate @ 18148] Some safety which should avoid a post-disconnect crash I've seen reported committer: Tailor Script <tailor@pidgin.im>
author Evan Schoenberg <evan.s@dreskin.net>
date Wed, 17 Jan 2007 15:07:07 +0000
parents db11d9e416ac
children 2db21e0292b8
files libgaim/protocols/oscar/flap_connection.c
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libgaim/protocols/oscar/flap_connection.c	Wed Jan 17 09:47:55 2007 +0000
+++ b/libgaim/protocols/oscar/flap_connection.c	Wed Jan 17 15:07:07 2007 +0000
@@ -359,7 +359,7 @@
 
 	conn = data;
 	od = conn->od;
-	account = gaim_connection_get_account(od->gc);
+	account = (GAIM_CONNECTION_IS_VALID(od->gc) ? gaim_connection_get_account(od->gc) : NULL);
 
 	gaim_debug_info("oscar", "Destroying oscar connection of "
 			"type 0x%04hx\n", conn->type);
@@ -370,8 +370,8 @@
 	 * TODO: If we don't have a SNAC_FAMILY_LOCATE connection then
 	 * we should try to request one instead of disconnecting.
 	 */
-	if (!account->disconnecting && ((od->oscar_connections == NULL)
-			|| (!flap_connection_getbytype(od, SNAC_FAMILY_LOCATE))))
+	if (account && !account->disconnecting &&
+		((od->oscar_connections == NULL) || (!flap_connection_getbytype(od, SNAC_FAMILY_LOCATE))))
 	{
 		/* No more FLAP connections!  Sign off this GaimConnection! */
 		gchar *tmp;