From 29ed6155a5d955893368d06bf6a61fb0d7f70ab9 Mon Sep 17 00:00:00 2001 From: Oliver Booth Date: Thu, 8 Dec 2022 18:31:06 +0000 Subject: [PATCH] Validate parameter length before invoking --- VpSharp.Commands/CommandsExtension.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/VpSharp.Commands/CommandsExtension.cs b/VpSharp.Commands/CommandsExtension.cs index fedfe32..a7f2fe5 100644 --- a/VpSharp.Commands/CommandsExtension.cs +++ b/VpSharp.Commands/CommandsExtension.cs @@ -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) {