diff --git a/indra/newview/llfloaterfriends.cpp b/indra/newview/llfloaterfriends.cpp index c28993742..481d8f31f 100644 --- a/indra/newview/llfloaterfriends.cpp +++ b/indra/newview/llfloaterfriends.cpp @@ -328,9 +328,10 @@ const S32& friend_name_system() return name_system; } -static void update_friend_item(LLScrollListItem* item, const LLAvatarName& avname) +static void update_friend_name(LLScrollListCtrl* list, const LLUUID& id, const LLAvatarName& avname) { - item->getColumn(1)->setValue(avname.getNSName(friend_name_system())); + if (LLScrollListItem* item = list->getItem(id)) + item->getColumn(1)->setValue(avname.getNSName(friend_name_system())); } void LLPanelFriends::addFriend(const LLUUID& agent_id) @@ -399,8 +400,8 @@ void LLPanelFriends::addFriend(const LLUUID& agent_id) .value(have_name ? relation_info->getChangeSerialNum() : -1); element.columns.add(cell); - LLScrollListItem* item(mFriendsList->addRow(element)); - if (!have_name) LLAvatarNameCache::get(agent_id, boost::bind(update_friend_item, item, _2)); + mFriendsList->addRow(element); + if (!have_name) LLAvatarNameCache::get(agent_id, boost::bind(update_friend_name, mFriendsList, _1, _2)); } // propagate actual relationship to UI. @@ -421,7 +422,7 @@ void LLPanelFriends::updateFriendItem(const LLUUID& agent_id, const LLRelationsh else { gCacheName->getFullName(agent_id, fullname); - LLAvatarNameCache::get(agent_id, boost::bind(update_friend_item, itemp, _2)); + LLAvatarNameCache::get(agent_id, boost::bind(update_friend_name, mFriendsList, _1, _2)); itemp->getColumn(LIST_FRIEND_UPDATE_GEN)->setValue(-1); }