msgpack / msgpack-cli

MessagePack implementation for Common Language Infrastructure / msgpack.org[C#]
http://msgpack.org
Apache License 2.0
834 stars 175 forks source link

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

Closed tchekjunior closed 7 years ago

tchekjunior commented 7 years ago

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?

yfakariya commented 7 years ago

Sorry, it is a critical bug. Thank you for reporting!

tchekjunior commented 7 years ago

hi, thank, i can investigate if you help me, i want to fix it quilkly. i use build dotNet3.5. I have meet order dysfonctionnement ,I write other issue after. but good job is very fast serializer.

tchekjunior commented 7 years ago

Thank you very much for your reactivity to this problem. i try it now. good job

yfakariya commented 7 years ago

Thank you. I will release it as 0.8.1 soon, and port to 0.9.0 branch in this weekend.

yfakariya commented 7 years ago

BTW, your "order dysfonctionnement" is related to #71?

yfakariya commented 7 years ago

Fixed in 7e73aff