Fix server crash if patch folder doesn't exist

This commit is contained in:
gsemaj 2021-05-05 15:44:00 -04:00 committed by Gent Semaj
parent 0ccc66208d
commit 9fb41342b3
1 changed files with 1 additions and 0 deletions

View File

@ -1145,6 +1145,7 @@ void TableData::init() {
fstream.close();
// patching: loop through every directory within the patch directory, looking for a matching file
if (!std::filesystem::exists(settings::PATCHDIR)) continue; // patch dir doesn't exist
json patch;
for (const auto& patchModule : std::filesystem::directory_iterator(settings::PATCHDIR)) {
// this is the theoretical path of a corresponding patch for this file