changeset 22922:abb17e7e2e98

For chats created using the "normal" (i.e. Join a Chat) flow, there will always be prpl_info->chat_info, but for stuff like the MSN conferences, there will not necessarily be. Eion Robb noticed this issue. Fixes #5777. -------------------------------------------------------------------------------
author Daniel Atallah <daniel.atallah@gmail.com>
date Tue, 13 May 2008 02:34:52 +0000
parents 277966d1987e
children dd3cb465d3e1 f26f6a854770
files libpurple/blist.c
diffstat 1 files changed, 9 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/blist.c	Mon May 12 02:56:24 2008 +0000
+++ b/libpurple/blist.c	Tue May 13 02:34:52 2008 +0000
@@ -2073,9 +2073,7 @@
 
 const char *purple_chat_get_name(PurpleChat *chat)
 {
-	struct proto_chat_entry *pce;
-	GList *parts;
-	char *ret;
+	char *ret = NULL;
 	PurplePlugin *prpl;
 	PurplePluginProtocolInfo *prpl_info = NULL;
 
@@ -2087,11 +2085,14 @@
 	prpl = purple_find_prpl(purple_account_get_protocol_id(chat->account));
 	prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl);
 
-	parts = prpl_info->chat_info(purple_account_get_connection(chat->account));
-	pce = parts->data;
-	ret = g_hash_table_lookup(chat->components, pce->identifier);
-	g_list_foreach(parts, (GFunc)g_free, NULL);
-	g_list_free(parts);
+	if (prpl_info->chat_info) {
+		struct proto_chat_entry *pce;
+		GList *parts = prpl_info->chat_info(purple_account_get_connection(chat->account));
+		pce = parts->data;
+		ret = g_hash_table_lookup(chat->components, pce->identifier);
+		g_list_foreach(parts, (GFunc)g_free, NULL);
+		g_list_free(parts);
+	}
 
 	return ret;
 }