Throw early when Lua function parameters are null.

This commit is contained in:
Matthias Mailänder
2023-05-19 16:21:25 +02:00
committed by Gustas
parent 52a916012f
commit 8433bc0948
2 changed files with 110 additions and 35 deletions

View File

@@ -50,7 +50,7 @@ namespace OpenRA.Scripting
try
{
if (!IsMethod)
throw new LuaException("Trying to invoke a ScriptMemberWrapper that isn't a method!");
throw new LuaException($"Trying to invoke a {nameof(ScriptMemberWrapper)} that isn't a method!");
var mi = (MethodInfo)Member;
var pi = mi.GetParameters();