mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-15 06:44:10 +02:00
Fixed crash when defer scope target doesn't exist
This commit is contained in:
parent
cfd2bab9fb
commit
c8f96a7a22
1 changed files with 9 additions and 0 deletions
|
@ -7283,7 +7283,16 @@ void BfModule::Visit(BfDeferStatement* deferStmt)
|
||||||
scope = &mCurMethodState->mHeadScope;
|
scope = &mCurMethodState->mHeadScope;
|
||||||
}
|
}
|
||||||
else if (deferStmt->mScopeName != NULL)
|
else if (deferStmt->mScopeName != NULL)
|
||||||
|
{
|
||||||
scope = FindScope(deferStmt->mScopeName, true);
|
scope = FindScope(deferStmt->mScopeName, true);
|
||||||
|
|
||||||
|
if (scope == NULL)
|
||||||
|
{
|
||||||
|
AssertErrorState();
|
||||||
|
// The scope doesn't exist, continue with the current scope so we still get an evaluation of the deferred code
|
||||||
|
scope = mCurMethodState->mCurScope;
|
||||||
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
scope = mCurMethodState->mCurScope;
|
scope = mCurMethodState->mCurScope;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue