diff --git a/indra/newview/llhudeffectlookat.cpp b/indra/newview/llhudeffectlookat.cpp index 7fc394442..d653c8283 100644 --- a/indra/newview/llhudeffectlookat.cpp +++ b/indra/newview/llhudeffectlookat.cpp @@ -550,8 +550,8 @@ void LLHUDEffectLookAt::render() static const LLCachedControl lookAtNames("LookAtNameSystem"); if (lookAtNames < 0) return; std::string text; - LLAvatarNameCache::getPNSName(static_cast(mSourceObject.get())->getID(), text, lookAtNames); - if (0 == text.compare(text.length() - 9, 9, " Resident")) + if (!LLAvatarNameCache::getPNSName(static_cast(mSourceObject.get())->getID(), text, lookAtNames)) return; + if (text.length() > 9 && 0 == text.compare(text.length() - 9, 9, " Resident")) text.erase(text.length() - 9); LLVector3 offset = gAgentCamera.getCameraPositionAgent() - target; offset.normalize();