diff src/protocols/jabber/chat.c @ 10607:bf4c9ce533ab

[gaim-migrate @ 12043] fix a segfault, fix an idiocy from other clients (that was already applied to oldstatus) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Thu, 17 Feb 2005 03:31:06 +0000
parents 1a97d5e88d12
children c4cb90065e1d
line wrap: on
line diff
--- a/src/protocols/jabber/chat.c	Wed Feb 16 22:14:51 2005 +0000
+++ b/src/protocols/jabber/chat.c	Thu Feb 17 03:31:06 2005 +0000
@@ -91,13 +91,16 @@
 JabberChat *jabber_chat_find(JabberStream *js, const char *room,
 		const char *server)
 {
-	JabberChat *chat;
+	JabberChat *chat = NULL;
 	char *room_jid;
 
-	room_jid = g_strdup_printf("%s@%s", room, server);
+	if(NULL != js->chats)
+	{
+		room_jid = g_strdup_printf("%s@%s", room, server);
 
-	chat = g_hash_table_lookup(js->chats, jabber_normalize(NULL, room_jid));
-	g_free(room_jid);
+		chat = g_hash_table_lookup(js->chats, jabber_normalize(NULL, room_jid));
+		g_free(room_jid);
+	}
 
 	return chat;
 }