Don't crash when trying to add assets with invalid path (closes #2299)

This commit is contained in:
Alexander Bock
2022-11-07 13:46:31 +01:00
parent fd27b63f4b
commit 8579a12785
+8 -1
View File
@@ -190,7 +190,14 @@ void AssetManager::update() {
ZoneScopedN("Adding queued assets")
std::filesystem::path path = generateAssetPath(_assetRootDirectory, asset);
Asset* a = retrieveAsset(path, "");
Asset* a = nullptr;
try {
a = retrieveAsset(path, "");
}
catch (const ghoul::RuntimeError& e) {
LERRORC(e.component, e.message);
continue;
}
const auto it = std::find(_rootAssets.cbegin(), _rootAssets.cend(), a);
if (it != _rootAssets.cend()) {