Skip to content

Null of comlex type in List<T> and Dictionary<TKey, TValue> deserialized as non-null object #211

@tchekjunior

Description

@tchekjunior

hi,
i have some problems to unpack list with null elements.
how to fix it please

public class SimpleItem
{
    public int Id;
    public SimpleItem()
    {
}
}
var items= new List<SimpleItem>();
                    items.Add(null);
items[0] = new SimpleItem();

var stream = new MemoryStream();
var context = new SerializationContext();
var serializer = context.GetSerializer<SimpleItem>();

serializer .Pack(stream, items);
stream.Position = 0;
var cloneItems = serializer .Unpack(stream);

cloneItems null item in list is not null, why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugDetected as bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions