Replace 'is' by 'as' and a null check in ScriptMemberWrapper

This commit is contained in:
abcdefg30
2020-09-22 19:14:52 +02:00
committed by Matthias Mailänder
parent 930f8ab207
commit 1a4b773fda

View File

@@ -86,9 +86,11 @@ namespace OpenRA.Scripting
{
foreach (var arg in clrArgs)
{
if (!(arg is LuaValue[]))
var table = arg as LuaValue[];
if (table == null)
continue;
foreach (var value in (LuaValue[])arg)
foreach (var value in table)
value.Dispose();
}
}