Clear the top variable when the event is not valid too

This commit is contained in:
smallmodel committed 2025-01-17 16:21:13 +01:00
1 parent 7f0c506fea
commit 87e5b6d41e
1 file changed
+2 -2
+2 -2
View File
@@ -541,8 +541,8 @@ void ScriptVM::executeCommandInternal<false>(
)
{
transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);
checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev);
}
@@ -552,9 +552,9 @@ void ScriptVM::executeCommandInternal<true>(
)
{
transferVarsToEvent(ev, fromVar, iParamCount);
checkValidEvent(ev, listener);
try {
checkValidEvent(ev, listener);
listener->ProcessScriptEvent(ev);
} catch (...) {
m_VMStack.GetTop().Clear();