diff options
| author | jackpoz <giacomopoz@gmail.com> | 2021-07-17 16:07:44 +0200 |
|---|---|---|
| committer | jackpoz <giacomopoz@gmail.com> | 2021-07-17 16:07:44 +0200 |
| commit | 5094363a9432966b00b9fa79c0a353746cd24378 (patch) | |
| tree | 4ed662217dd0d837a2147d3cc79efb7d38a08ea4 /src | |
| parent | 8c42b3bd88fe7bd3e959664312e818e25996873a (diff) | |
Scripts/Commands: Fix ".server debug" crashing in some special conditions
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/scripts/Commands/cs_server.cpp | 3 |
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 d9ed45e43f0..a0c1e3da41b 100644 --- a/src/server/scripts/Commands/cs_server.cpp +++ b/src/server/scripts/Commands/cs_server.cpp @@ -215,7 +215,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; }); |
