# HG changeset patch # User Mark Doliner # Date 1185094443 0 # Node ID c5be17bbb6e4674f338e5fc53293ee31bccb013e # Parent 43a331f88c689e3e5465bda5d3f06fbd54384d16 Get rid of a crash that happens when signing off if you have a chat room open diff -r 43a331f88c68 -r c5be17bbb6e4 libpurple/protocols/oscar/oscar.c --- a/libpurple/protocols/oscar/oscar.c Sun Jul 22 08:30:12 2007 +0000 +++ b/libpurple/protocols/oscar/oscar.c Sun Jul 22 08:54:03 2007 +0000 @@ -1431,7 +1431,6 @@ purple_parse_auth_securid_request_no_cb(gpointer user_data, const char *value) { PurpleConnection *gc = user_data; - OscarData *od = gc->proto_data; /* Disconnect */ gc->wants_to_die = TRUE; @@ -3473,25 +3472,28 @@ if (conn->type == SNAC_FAMILY_CHAT) { struct chat_connection *cc; - PurpleConversation *conv; + PurpleConversation *conv = NULL; cc = find_oscar_chat_by_conn(gc, conn); - conv = purple_find_chat(gc, cc->id); - - if (conv != NULL) + if (cc != NULL) { - /* - * TOOD: Have flap_connection_destroy_cb() send us the - * error message stored in 'tmp', which should be - * human-friendly, and print that to the chat room. - */ - gchar *buf; - buf = g_strdup_printf(_("You have been disconnected from chat " - "room %s."), cc->name); - purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL)); - g_free(buf); + conv = purple_find_chat(gc, cc->id); + + if (conv != NULL) + { + /* + * TOOD: Have flap_connection_destroy_cb() send us the + * error message stored in 'tmp', which should be + * human-friendly, and print that to the chat room. + */ + gchar *buf; + buf = g_strdup_printf(_("You have been disconnected from chat " + "room %s."), cc->name); + purple_conversation_write(conv, NULL, buf, PURPLE_MESSAGE_ERROR, time(NULL)); + g_free(buf); + } + oscar_chat_kill(gc, cc); } - oscar_chat_kill(gc, cc); } return 1;