Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions indra/llfilesystem/lldir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,10 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)

std::vector<std::string> v;

if (exists(p))
boost::system::error_code ec;
if (exists(p, ec) && !ec.failed())
{
if (is_directory(p))
if (is_directory(p, ec) && !ec.failed())
{
boost::filesystem::directory_iterator end_iter;
for (boost::filesystem::directory_iterator dir_itr(p);
Expand Down
16 changes: 14 additions & 2 deletions indra/newview/llviewerwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4780,7 +4780,18 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
#else
boost::filesystem::path b_path(lastSnapshotDir);
#endif
if (!boost::filesystem::is_directory(b_path))
boost::system::error_code ec;
if (!boost::filesystem::is_directory(b_path, ec) || ec.failed())
{
LLSD args;
args["PATH"] = lastSnapshotDir;
LLNotificationsUtil::add("SnapshotToLocalDirNotExist", args);
resetSnapshotLoc();
failure_cb();
return;
}
boost::filesystem::space_info b_space = boost::filesystem::space(b_path, ec);
if (ec.failed())
{
LLSD args;
args["PATH"] = lastSnapshotDir;
Expand All @@ -4789,7 +4800,6 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
failure_cb();
return;
}
boost::filesystem::space_info b_space = boost::filesystem::space(b_path);
if (b_space.free < image->getDataSize())
{
LLSD args;
Expand All @@ -4806,6 +4816,8 @@ void LLViewerWindow::saveImageLocal(LLImageFormatted *image, const snapshot_save
LLNotificationsUtil::add("SnapshotToComputerFailed", args);

failure_cb();

// Shouldn't there be a return here?
}

// Look for an unused file name
Expand Down