fixed NPE in resetting entity event

This commit is contained in:
gnembon committed 2020-11-06 00:11:13 -04:00
1 parent 79dc85274d
commit 390dbe1725
1 file changed
+2 -1
@@ -8,6 +8,7 @@ import carpet.script.value.FunctionValue;
import carpet.script.value.Value;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
public class FunctionArgument extends Argument
@@ -46,7 +47,7 @@ public class FunctionArgument extends Argument
Value functionValue = params.get(offset).evalValue(c);
if (functionValue.isNull())
{
if (allowNone) return new FunctionArgument(null, offset+1, null);
if (allowNone) return new FunctionArgument(null, offset+1, Collections.emptyList());
throw new InternalExpressionException("function argument cannot be null");
}
if (!(functionValue instanceof FunctionValue))