diff --git a/ext/ghoul b/ext/ghoul index 62d6b98d7d..fed2001d06 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 62d6b98d7d33535d31f7029f0118c074ada5810d +Subproject commit fed2001d06211d5636452500870f83d1adb10ba2 diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index e8a423df53..b6fb131298 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -78,8 +78,10 @@ bool ConfigurationManager::loadFromFile(const std::string& filename) { FileSys.registerPathToken(basePathToken, basePath); // Loading the configuration file into ourselves - const bool loadingSuccess = ghoul::lua::loadDictionaryFromFile(filename, *this); - if (!loadingSuccess) { + try { + ghoul::lua::loadDictionaryFromFile(filename, *this); + } + catch (...) { LERROR("Loading dictionary from file failed"); return false; } diff --git a/src/scene/scenegraph.cpp b/src/scene/scenegraph.cpp index 33a9bf607d..6f00479de4 100644 --- a/src/scene/scenegraph.cpp +++ b/src/scene/scenegraph.cpp @@ -90,9 +90,12 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) { // Load dictionary ghoul::Dictionary sceneDictionary; - bool success = ghoul::lua::loadDictionaryFromFile(absSceneFile, sceneDictionary); - if (!success) + try { + ghoul::lua::loadDictionaryFromFile(absSceneFile, sceneDictionary); + } + catch (...) { return false; + } std::string sceneDescriptionDirectory = ghoul::filesystem::File(absSceneFile, true).directoryName(); @@ -116,7 +119,7 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) { } ghoul::Dictionary moduleDictionary; - success = sceneDictionary.getValue(KeyModules, moduleDictionary); + bool success = sceneDictionary.getValue(KeyModules, moduleDictionary); if (!success) // There are no modules that are loaded return true; @@ -182,9 +185,12 @@ bool SceneGraph::loadFromFile(const std::string& sceneDescription) { } ghoul::Dictionary moduleDictionary; - bool s = ghoul::lua::loadDictionaryFromFile(moduleFile, moduleDictionary, state); - if (!s) + try { + ghoul::lua::loadDictionaryFromFile(moduleFile, moduleDictionary, state); + } + catch (...) { continue; + } std::vector keys = moduleDictionary.keys(); for (const std::string& key : keys) {