aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackpoz <giacomopoz@gmail.com>2021-07-17 16:07:44 +0200
committerShauren <shauren.trinity@gmail.com>2022-03-11 18:37:13 +0100
commitc2b8c13a9819d04f1d3ea968c199c9c2d41a16d4 (patch)
treed5a2ed4ac48468e4b3a90e74132ae34d17417547 /src
parent6fd7cd9dc9ca2f3ce2e90d719b292f0249972f93 (diff)
Scripts/Commands: Fix ".server debug" crashing in some special conditions
(cherry picked from commit 5094363a9432966b00b9fa79c0a353746cd24378)
Diffstat (limited to 'src')
-rw-r--r--src/server/scripts/Commands/cs_server.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/server/scripts/Commands/cs_server.cpp b/src/server/scripts/Commands/cs_server.cpp
index edc83157e2d..20b7961f13c 100644
--- a/src/server/scripts/Commands/cs_server.cpp
+++ b/src/server/scripts/Commands/cs_server.cpp
@@ -213,7 +213,8 @@ public:
auto end = boost::filesystem::directory_iterator();
std::size_t folderSize = std::accumulate(boost::filesystem::directory_iterator(mapPath), end, std::size_t(0), [](std::size_t val, boost::filesystem::path const& mapFile)
{
- if (boost::filesystem::is_regular_file(mapFile))
+ boost::system::error_code ec;
+ if (boost::filesystem::is_regular_file(mapFile, ec))
val += boost::filesystem::file_size(mapFile);
return val;
});