# HG changeset patch # User Christian Hammond # Date 1043565427 0 # Node ID be8f9ca74ddfd8b6c356029a4798ea2ae67576b7 # Parent eb116cc20200128a1226fb9d29eb81751bbbd53d [gaim-migrate @ 4700] Gaim should no longer crash when the user is NULL and the conversation is closed. This happened for instance when a user typed /part in an IRC channel and then closed the tab. committer: Tailor Script diff -r eb116cc20200 -r be8f9ca74ddf src/conversation.c --- a/src/conversation.c Sun Jan 26 06:03:59 2003 +0000 +++ b/src/conversation.c Sun Jan 26 07:17:07 2003 +0000 @@ -890,7 +890,7 @@ * * -- ChipX86 */ - if (g_slist_find(gc->buddy_chats, conv) != NULL) { + if (gc && g_slist_find(gc->buddy_chats, conv) != NULL) { serv_chat_leave(gc, gaim_chat_get_id(GAIM_CHAT(conv))); return; @@ -1010,10 +1010,17 @@ struct gaim_connection * gaim_conversation_get_gc(const struct gaim_conversation *conv) { + struct aim_user *user; + if (conv == NULL) return NULL; - return gaim_conversation_get_user(conv)->gc; + user = gaim_conversation_get_user(conv); + + if (user == NULL) + return NULL; + + return user->gc; } void