mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 00:37:15 +01:00
Make the audit stage optional.
Also fix bug where the execution function is not invoked without binding an audit function first which enables it.
This commit is contained in:
parent
47ff628a46
commit
cb0598d228
@ -400,16 +400,23 @@ int32_t Controller::Exec(Context & ctx)
|
||||
args = LightObj(arr.GetObj());
|
||||
}
|
||||
// Allow the user to audit the command parameters
|
||||
try
|
||||
if (!ctx.mInstance->m_OnAudit.IsNull())
|
||||
{
|
||||
result = ctx.mInstance->Audit(ctx.mInvoker, args);
|
||||
try
|
||||
{
|
||||
result = ctx.mInstance->Audit(ctx.mInvoker, args);
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
{
|
||||
// Let's store the exception message
|
||||
ctx.mBuffer.WriteS(0, e.what());
|
||||
// Specify that the command execution failed
|
||||
failed = true;
|
||||
}
|
||||
}
|
||||
catch (const std::exception & e)
|
||||
else
|
||||
{
|
||||
// Let's store the exception message
|
||||
ctx.mBuffer.WriteS(0, e.what());
|
||||
// Specify that the command execution failed
|
||||
failed = true;
|
||||
result = SQTrue;
|
||||
}
|
||||
// Did parameter audit succeeded?
|
||||
if (result && !failed)
|
||||
|
Loading…
Reference in New Issue
Block a user