Workaround for boost uncaught exception problem on MacOS 10.5.

This commit is contained in:
lotodore
2007-12-07 23:29:49 +00:00
parent a798e051d6
commit 5f0fc7ab93
+11 -1
View File
@@ -515,10 +515,14 @@ bool
AvatarManager::InternalReadDirectory(const std::string &dir, AvatarMap &avatars) AvatarManager::InternalReadDirectory(const std::string &dir, AvatarMap &avatars)
{ {
bool retVal = true; bool retVal = true;
path tmpPath(dir);
if (exists(tmpPath) && is_directory(tmpPath))
{
try try
{ {
// This method is not thread safe. Only call after locking the map. // This method is not thread safe. Only call after locking the map.
directory_iterator i(dir); directory_iterator i(tmpPath);
directory_iterator end; directory_iterator end;
while (i != end) while (i != end)
@@ -541,6 +545,12 @@ AvatarManager::InternalReadDirectory(const std::string &dir, AvatarMap &avatars)
LOG_ERROR("Exception caught when trying to scan avatar directory."); LOG_ERROR("Exception caught when trying to scan avatar directory.");
retVal = false; retVal = false;
} }
}
else
{
LOG_ERROR("Avatar directory does not exist.");
retVal = false;
}
return retVal; return retVal;
} }