diff options
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index eabb9e0b23..d8c2987470 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 ); |