pidgin: b842f41e: Do not crash from commands in a disconne...

sadrul at pidgin.im sadrul at pidgin.im
Sun Apr 13 13:40:52 EDT 2008


-----------------------------------------------------------------
Revision: b842f41e3866c11d89406467665d9f79235bf633
Ancestor: e5b7004bba36a7abe811e62429b887d62fa9247e
Author: sadrul at pidgin.im
Date: 2008-04-13T16:54:33
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b842f41e3866c11d89406467665d9f79235bf633

Modified files:
        libpurple/protocols/jabber/chat.c

ChangeLog: 

Do not crash from commands in a disconnected chat. Fixes #5208

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/chat.c	b5b8660c8310f8cb7b35e270bafa23c575157d82
+++ libpurple/protocols/jabber/chat.c	b64f04003efc606418fa6f1ed98790f6b947a6c1
@@ -137,9 +137,12 @@ JabberChat *jabber_chat_find_by_conv(Pur
 {
 	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);
 }
 


More information about the Commits mailing list