libgaim/protocols/oscar/flap_connection.c

changeset 15417
c10f76ea0a1d
parent 15256
c57887cd5d08
child 20471
1966704b3e42
child 20472
6a6d2ef151e6
--- 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;

mercurial