fixed empty functions causing errors

This commit is contained in:
Evil Factory
2021-12-09 11:59:11 -03:00
parent 1f2eaf765f
commit d7655fa1a7

View File

@@ -422,6 +422,7 @@ namespace Barotrauma
var cmd = new DebugConsole.Command(name, help, (string[] arg1) => { env.CallFunction(onExecute, new object[] { arg1 }); },
() =>
{
if (getValidArgs == null) return null;
var result = env.CallFunction(getValidArgs, new object[] { });
if (result == null || !(result is string[][])) { return null; }
return (string[][])result;