From 1be0d260da62542dd27b8a6f5d367a2e79191a8d Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 13 Mar 2010 00:12:07 +0000 Subject: Fixed handling of contact lists where at least the first contact is not in any group yet. Crashing is not the right solution. --- protocols/yahoo/libyahoo2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'protocols') diff --git a/protocols/yahoo/libyahoo2.c b/protocols/yahoo/libyahoo2.c index 57c32e2d..5b2ff44e 100644 --- a/protocols/yahoo/libyahoo2.c +++ b/protocols/yahoo/libyahoo2.c @@ -1493,13 +1493,14 @@ static void yahoo_process_buddy_list(struct yahoo_input_data *yid, newbud->id = strdup(pair->value); if (cur_group) newbud->group = strdup(cur_group); - else { + else if (yd->buddies) { struct yahoo_buddy *lastbud = (struct yahoo_buddy *)y_list_nth(yd-> buddies, y_list_length(yd->buddies) - 1)->data; newbud->group = strdup(lastbud->group); - } + } else + newbud->group = strdup("Buddies"); yd->buddies = y_list_append(yd->buddies, newbud); -- cgit v1.2.3