[Maps]: Fix fatal crash (#837)

This commit is contained in:
Edo 2023-03-17 13:24:00 +00:00 committed by GitHub
parent 678dc349dd
commit 48f2cbc06d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -605,9 +605,15 @@ namespace Components
FoundCustomMaps.clear();
Logger::Print("Scanning custom maps...\n");
auto basePath = std::format("{}\\usermaps", (*Game::fs_basepath)->current.string);
std::filesystem::path basePath = (*Game::fs_basepath)->current.string;
basePath /= "usermaps";
auto entries = Utils::IO::ListFiles(basePath);
if (!std::filesystem::exists(basePath))
{
return;
}
const auto entries = Utils::IO::ListFiles(basePath);
for (const auto& entry : entries)
{