diff --git a/indra/newview/lggcontactsets.cpp b/indra/newview/lggcontactsets.cpp index 122d94c5ed..17a8777b22 100644 --- a/indra/newview/lggcontactsets.cpp +++ b/indra/newview/lggcontactsets.cpp @@ -91,7 +91,14 @@ std::string LGGContactSets::getOldFileName() std::string normalPath=gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, ""); //we want to steal the last directory off this one - std::string userNameDir = normalPath.substr(normalPath.find_last_of(gDirUtilp->getDirDelimiter())); + + std::string userNameDir; + + if( normalPath.size() && std::string::npos != normalPath.find_last_of( gDirUtilp->getDirDelimiter() ) ) + userNameDir = normalPath.substr(normalPath.find_last_of(gDirUtilp->getDirDelimiter())); + else + userNameDir = normalPath; + path += userNameDir; if (!path.empty())