I did not find anything on this topic besides this thread which does not directly answer my question. I was wondering wether there is a simpler approach than the one referred to in the thread which in the end still uses a flat array: Blob Hashmap
As I’m targeting sub-arrays with individual lengths avoiding flat arrays would be favoured - if possible.
In the documentation of entities 0.51 it says:
“Blob assets can contain primitive types, strings, structs, arrays, and arrays of arrays.”
But could not make it work - the referenced arrayBuilder in line 14 throws a nullref. I understand one can’t simply use the new keyword for BlobArrays and that you need to allocate memory for the BlobArray using the BlobBuilderArray.
The other overload for BlobBuilder.Allocate with an alignment parameter is - as far as I understand - for optimizing memory access - so what am I missing here?
Maybe I’m missing something, but I have done something very similar to the code you have without issue. Could you provide a stack trace with the error you are getting?
My understanding is that there shouldn’t be cause for any NRE coming from trying to do something with the BlobBuilderArray indexer. Are you sure it’s not an unset element of inputArray and the error is on 15?
You are absolutely right - that was indeed the issue here, some sub arrays were unset! My bad - should have checked that before!
Thank you both for the quick help.