changeset 22644:d14294a40d74

Do not crash from commands in a disconnected chat. Fixes #5208
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 13 Apr 2008 16:54:33 +0000
parents 0de4b47d36ab
children f75509f776cc
files libpurple/protocols/jabber/chat.c
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/chat.c	Sun Apr 13 16:28:57 2008 +0000
+++ b/libpurple/protocols/jabber/chat.c	Sun Apr 13 16:54:33 2008 +0000
@@ -137,9 +137,12 @@
 {
 	PurpleAccount *account = purple_conversation_get_account(conv);
 	PurpleConnection *gc = purple_account_get_connection(account);
-	JabberStream *js = gc->proto_data;
-	int id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv));
-
+	JabberStream *js;
+	int id;
+	if (!gc)
+		return NULL;
+	js = gc->proto_data;
+	id = purple_conv_chat_get_id(PURPLE_CONV_CHAT(conv));
 	return jabber_chat_find_by_id(js, id);
 }