changeset 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 1a65fc2d7978
children adf7adc7da76
files src/protocols/jabber/chat.c src/protocols/jabber/message.c
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
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;
 }
--- a/src/protocols/jabber/message.c	Wed Feb 16 22:14:51 2005 +0000
+++ b/src/protocols/jabber/message.c	Thu Feb 17 03:31:06 2005 +0000
@@ -289,7 +289,7 @@
 			if(!jm->body)
 				jm->body = xmlnode_to_str(child, NULL);
 		} else if(!strcmp(child->name, "html")) {
-			if(!jm->xhtml)
+			if(!jm->xhtml && child->data_sz > 0)
 				jm->xhtml = xmlnode_to_str(child, NULL);
 		} else if(!strcmp(child->name, "error")) {
 			const char *code = xmlnode_get_attrib(child, "code");