I have a created a template in a .scriban
file, but it doesn't seem to work.
This is the snippet of the array I want to filter:
{{~ somevar = SomeArray | array.filter sub(sv) | array.first ~}}
And the custom function that should be called is:
{{func sub(sv)
ret sv.Code == "99"
end}}
It seems that it calls the custom function, but I receive this error:
Scriban.Syntax.ScriptRuntimeException: '<input>(2,12) : error : Cannot get the member sv.Code for a null object.'
What am I doing wrong here?