Fixing some potential crashes

This commit is contained in:
Dynamitos
2025-04-08 22:01:42 +02:00
parent 875ae450e7
commit e355f3e703
7 changed files with 22 additions and 97 deletions
+8
View File
@@ -224,6 +224,14 @@ void AssetRegistry::initialize(const std::filesystem::path& _rootFolder, Gfx::PG
this->graphics = _graphics;
this->rootFolder = _rootFolder;
this->assetRoot = new AssetFolder("");
if (!std::filesystem::exists(rootFolder))
{
std::filesystem::create_directories(rootFolder);
}
else if (!std::filesystem::is_directory(rootFolder))
{
throw std::logic_error("Asset Folder is not a directory!!");
}
loadRegistryInternal();
}