# HG changeset patch # User Paul Aurich # Date 1234574305 0 # Node ID b3dbc9e8b6ef76a6d1213509ef9e965c5bf7d935 # Parent ab07969d298fbecd46041855ab176afa90add049 I had the distinct pleasure of throwing invalid garbage at this code; it generated many errors like g_log: xmlnode_get_child_with_namespace: assertion `parent != NULL' failed Instead, let's handle it nicely... diff -r ab07969d298f -r b3dbc9e8b6ef libpurple/protocols/jabber/useravatar.c --- a/libpurple/protocols/jabber/useravatar.c Thu Feb 05 01:00:17 2009 +0000 +++ b/libpurple/protocols/jabber/useravatar.c Sat Feb 14 01:18:25 2009 +0000 @@ -236,6 +236,9 @@ server_hash = xmlnode_get_attrib(info, "id"); } + if (!metadata) + return; + ns = xmlnode_get_namespace(metadata); if (!ns) return; @@ -338,8 +341,13 @@ if(!buddy) return; - checksum = purple_buddy_icons_get_checksum_for_user(buddy); + if (!items) + return; + item = xmlnode_get_child(items,"item"); + if (!item) + return; + metadata = xmlnode_get_child(item, "metadata"); if(!metadata) return; @@ -350,6 +358,8 @@ strcmp(ns, NS_AVATAR_1_1_METADATA))) return; + checksum = purple_buddy_icons_get_checksum_for_user(buddy); + /* check if we have received a stop */ if(xmlnode_get_child(metadata, "stop")) { purple_buddy_icons_set_for_user(purple_connection_get_account(js->gc), from, NULL, 0, NULL);