changeset 4425:be8f9ca74ddf

[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 <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Sun, 26 Jan 2003 07:17:07 +0000
parents eb116cc20200
children 3299863ab060
files src/conversation.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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