Validate parameter length before invoking

This commit is contained in:
Oliver Booth 2022-12-08 18:31:06 +00:00
parent 2f3069d1bf
commit 29ed6155a5
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
1 changed files with 5 additions and 0 deletions

View File

@ -269,6 +269,11 @@ public sealed class CommandsExtension : VirtualParadiseClientExtension
}
}
if (command.Method.GetParameters().Length != arguments.Length)
{
return base.OnMessageReceived(args);
}
object? returnValue = command.Method.Invoke(command.Module, arguments);
if (returnValue is Task task)
{