1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-01-18 19:47: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:
Sandu Liviu Catalin 2021-05-05 17:51:07 +03:00
parent 47ff628a46
commit cb0598d228

View File

@ -400,6 +400,8 @@ int32_t Controller::Exec(Context & ctx)
args = LightObj(arr.GetObj());
}
// Allow the user to audit the command parameters
if (!ctx.mInstance->m_OnAudit.IsNull())
{
try
{
result = ctx.mInstance->Audit(ctx.mInvoker, args);
@ -411,6 +413,11 @@ int32_t Controller::Exec(Context & ctx)
// Specify that the command execution failed
failed = true;
}
}
else
{
result = SQTrue;
}
// Did parameter audit succeeded?
if (result && !failed)
{