changeset 7316:5b408a3fc6f4

[gaim-migrate @ 7900] this _might_ fix empty group names (it at least shouldn't crash) committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Wed, 22 Oct 2003 16:38:37 +0000
parents 7e5f9d7e9291
children 9b303dd88cb2
files src/protocols/jabber/roster.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/jabber/roster.c	Wed Oct 22 15:52:46 2003 +0000
+++ b/src/protocols/jabber/roster.c	Wed Oct 22 16:38:37 2003 +0000
@@ -193,10 +193,13 @@
 			GSList *groups = NULL;
 
 			for(group = item->child; group; group = group->next) {
+				char *group_name;
 				if(group->type != NODE_TYPE_TAG || strcmp(group->name, "group"))
 					continue;
-				groups = g_slist_append(groups,
-						xmlnode_get_data(group));
+
+				if(!(group_name = xmlnode_get_data(group)))
+					group_name = g_strdup("");
+				groups = g_slist_append(groups, group_name);
 			}
 			add_gaim_buddies_in_groups(js, jid, name, groups);
 		}