# HG changeset patch # User Paul Aurich # Date 1280607539 0 # Node ID a0d6b85e9c4235d899530dbbf08e63e015bacfa1 # Parent 30f16cb2f73667fc1c2cdfff1ff6b750ac8884a9 jabber: Avoid an assertion warning As noticed by Elliott diff -r 30f16cb2f736 -r a0d6b85e9c42 libpurple/protocols/jabber/chat.c --- a/libpurple/protocols/jabber/chat.c Fri Jul 30 07:28:00 2010 +0000 +++ b/libpurple/protocols/jabber/chat.c Sat Jul 31 20:18:59 2010 +0000 @@ -173,8 +173,10 @@ xmlnode_set_namespace(x, "http://jabber.org/protocol/muc#user"); invite = xmlnode_new_child(x, "invite"); xmlnode_set_attrib(invite, "to", name); - body = xmlnode_new_child(invite, "reason"); - xmlnode_insert_data(body, msg, -1); + if (msg) { + body = xmlnode_new_child(invite, "reason"); + xmlnode_insert_data(body, msg, -1); + } } else { xmlnode_set_attrib(message, "to", name); /* @@ -184,14 +186,17 @@ * * Left here for compatibility. */ - body = xmlnode_new_child(message, "body"); - xmlnode_insert_data(body, msg, -1); + if (msg) { + body = xmlnode_new_child(message, "body"); + xmlnode_insert_data(body, msg, -1); + } x = xmlnode_new_child(message, "x"); xmlnode_set_attrib(x, "jid", room_jid); /* The better place for it! XEP-0249 style. */ - xmlnode_set_attrib(x, "reason", msg); + if (msg) + xmlnode_set_attrib(x, "reason", msg); xmlnode_set_namespace(x, "jabber:x:conference"); }