FlowCanvas Forums › Support › GetRange node, ‘null reference’
Hi, List.GetRange node throws ‘null reference’ error, in 100% cases in IL2CPP/Net4.0 build, any list type(mine audioclips list), any range, any unity version(mine unity 2020.3) just throws null reference. Bug possibly?
Is there quickfix that i can fix in that node?
or can you help me make simplex node, here what i have so far(but this throws errors):
1 2 3 4 5 | public class ListGetRange<T> : PureFunctionNode<List<T>, int, int>{ public override List<T> Invoke(List<T> list, int index, int count){ return list.GetRange(index, count); } } |
Hello,
Have you built the AOTClasses and link.xml files through the Preferred Types Editor? (DOC LINK). If so, could you please post the error you are getting?
Here is the code for the PureFunctionNode you requested. The code was simply missing another List<T> parameter:
1 2 3 4 5 6 7 8 9 | public class ListGetRange<T> : PureFunctionNode<List<T>, List<T>, int, int> { public override List<T> Invoke(List<T> list, int index, int count) { return list.GetRange(index, count); } } |
Please let me know.
Thanks!
Hi, thanks for the node example, it works!
About that error in List.GetRange node, yes AOT was generated, it was throwing “null reference exception”, there is something wrong in that node, just try to build(in IL2CPP) empty project with only this node getting any range from any list, as a test