Handle case where engine.json missing or corrupt (#7049)

Signed-off-by: Alex Peterson <26804013+AMZN-alexpete@users.noreply.github.com>
This commit is contained in:
Alex Peterson
2022-01-21 13:09:09 -08:00
committed by GitHub
parent 93358dcbeb
commit 1909e5fa54
3 changed files with 8 additions and 6 deletions
@@ -196,9 +196,7 @@ namespace O3DE::ProjectManager
return true;
}
bool forceRegistration = false;
// check if an engine with this name is already registered
// check if an engine with this name is already registered and has a valid engine.json
auto existingEngineResult = m_pythonBindings->GetEngineInfo(engineInfo.m_name);
if (existingEngineResult)
{
@@ -230,10 +228,11 @@ namespace O3DE::ProjectManager
// user elected not to change the name or force registration
return false;
}
forceRegistration = true;
}
// always force register in case there is an engine registered in o3de_manifest.json, but
// the engine.json is missing or corrupt in which case GetEngineInfo() fails
constexpr bool forceRegistration = true;
auto registerOutcome = m_pythonBindings->SetEngineInfo(engineInfo, forceRegistration);
if (!registerOutcome)
{