From abaaf437b61123b2873b40ed830ace63dd40188a Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 20 Feb 2022 19:30:23 +0100 Subject: [PATCH] Don't try to initialize an asset if the initialization has failed (closes #1830) --- src/scene/assetmanager.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 06a6c61cd8..5d81948e62 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -182,8 +182,13 @@ void AssetManager::update() { continue; } - _rootAssets.push_back(a); a->load(nullptr); + if (a->isFailed()) { + // The loading might fail because of any number of reasons, most likely of + // them some Lua syntax error + continue; + } + _rootAssets.push_back(a); a->startSynchronizations(); _toBeInitialized.push_back(a);