pizheng / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

Incorrect deserialization of array with null values #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please include an e-mail address if this might need a dialogue!
==============

What steps will reproduce the problem?
var arr = new[] {"aaa", null, "bbb"};
var arr2 = Serializer.DeepClone(arr); // {"aaa", "bbb"}

What is the expected output? What do you see instead?
Null values in array should be serialized correctly, now they are skipped.

What version of the product are you using? On what operating system?
protobuf-net r282.zip 
Windows 7 x64

Please provide any additional information below.

Original issue reported on code.google.com by mace...@gmail.com on 3 May 2011 at 3:07

GoogleCodeExporter commented 9 years ago
The protobuf spec (outside my control) has no mechanism for null. "v2" now 
throws an exception in this scenario, which is my preferred behaviour.

Original comment by marc.gravell on 13 Jun 2011 at 8:39