Fix: Crash if squirrel compatibility scripts cannot be parsed. (#11589)

This commit is contained in:
Peter Nelson 2023-12-15 01:25:36 +00:00 committed by GitHub
parent 7726f8f245
commit 302e8852c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -76,6 +76,10 @@ void ScriptInstance::Initialize(const std::string &main_script, const std::strin
/* Register the API functions and classes */
this->engine->SetGlobalPointer(this->engine);
this->RegisterAPI();
if (this->IsDead()) {
/* Failed to register API; a message has already been logged. */
return;
}
try {
ScriptObject::SetAllowDoCommand(false);