Apollo3zehn/PureHDF

Setting an entry on a H5Group to null breaks writing

Closed this issue · 2 comments

I've done something unexpected that is I've set an entry to null as it was set by the return of a function.

This breaks in the NativeWriter.EncodeGroup function as this:

            else if (entry.Value is object objectDataset)

does not match null objects.

My suggestion would be to either explicitly check for null and handle that differently (possibly by skipping the value alltogether) or is there something like a Null Dataset?

Could you send me some simple sample to reproduce the issue? Setting an entry to null should give you a compile time warning (in case <Nullable>enable</Nullable> is set in the project properties).

There is no null dataset, only null dataspace. The entries always need to be either a non-null value or be of type H5Dataset<T>, otherwise all type information is lost (null carries no runtime type information) and then PureHDF has no way to create the dataset in the HDF5 file.

I will close this issue for now because I am preparing a v1 release. Feel free to reopen it (or open a new one) if the problem is not yet solved for you.