# HG changeset patch # User Nathan Walp # Date 1108611066 0 # Node ID bf4c9ce533aba2863de5ccae86cf6d6b64ae41a2 # Parent 1a65fc2d79787744b9cff7ec1a8234affe697cac [gaim-migrate @ 12043] fix a segfault, fix an idiocy from other clients (that was already applied to oldstatus) committer: Tailor Script diff -r 1a65fc2d7978 -r bf4c9ce533ab src/protocols/jabber/chat.c --- 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; } diff -r 1a65fc2d7978 -r bf4c9ce533ab src/protocols/jabber/message.c --- 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");