aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/util
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/util')
-rw-r--r--NorthstarDLL/util/printmaps.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/NorthstarDLL/util/printmaps.cpp b/NorthstarDLL/util/printmaps.cpp
index dd825bff..5b406c4c 100644
--- a/NorthstarDLL/util/printmaps.cpp
+++ b/NorthstarDLL/util/printmaps.cpp
@@ -104,7 +104,13 @@ void RefreshMapList()
}
// get maps in game dir
- for (fs::directory_entry file : fs::directory_iterator(fmt::format("{}/maps", R2::g_pModName)))
+ std::string gameDir = fmt::format("{}/maps", R2::g_pModName);
+ if (!std::filesystem::exists(gameDir))
+ {
+ return;
+ }
+
+ for (fs::directory_entry file : fs::directory_iterator(gameDir))
{
if (file.path().extension() == ".bsp")
{