diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index eabb9e0b23e67b396e58621adce841cc4d81b17e..d8c298747009716f552f8764e22f8358a5020642 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -175,13 +175,21 @@ LLScrollListItem* LLNameListCtrl::addElement(const LLSD& value, EAddPosition pos char first[DB_FIRST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ char last[DB_LAST_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ - gCacheName->getName(item->getUUID(), first, last); - LLString fullname; - fullname.assign(first); - fullname.append(1, ' '); - fullname.append(last); - + if (gCacheName->getName(item->getUUID(), first, last)) + { + fullname.assign(first); + fullname.append(1, ' '); + fullname.append(last); + } + else // didn't work as a resident name, try looking up as a group + { + char group_name[DB_GROUP_NAME_BUF_SIZE]; /*Flawfinder: ignore*/ + gCacheName->getGroupName(item->getUUID(), group_name); + // fullname will be "nobody" if group not found + fullname = group_name; + } + LLScrollListCell* cell = (LLScrollListCell*)item->getColumn(mNameColumnIndex); ((LLScrollListText*)cell)->setText( fullname );