bool isParameterIndexValid(int? index) { return index != null && index >= 0 && index < customFunction.parameters.length; }