[CSHARP-674] Error serializing key-value pairs with a null value Created: 06/Feb/13  Updated: 20/Mar/14  Resolved: 10/Feb/13

Status: Closed
Project: C# Driver
Component/s: None
Affects Version/s: 1.7, 1.8
Fix Version/s: 1.8

Type: Bug Priority: Major - P3
Reporter: Daniel Goldman Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If the value in a KeyValuePair is null, the following line (173 in 1.7, 170 in 1.8) in the KeyValuePairSerializer throws an exception:

var valueSerializer = GetValueSerializer(keyValuePair.Value.GetType());



 Comments   
Comment by auto [ 10/Feb/13 ]

Author:

{u'date': u'2013-02-07T03:28:08Z', u'name': u'Robert Stam', u'email': u'robert@10gen.com'}

Message: CSHARP-674: Handle null keys as well as null values in KeyValuePairSerializer.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/a6465a6eca319afea8dfa7577e9a5b2168f55887

Comment by auto [ 10/Feb/13 ]

Author:

{u'date': u'2013-02-06T18:13:29Z', u'name': u'dhgoldman', u'email': u'daniel@stackwave.com'}

Message: CSHARP-674: Handle null values in the KeyValuePairSerializer.

Added a unit test for a KeyValuePair with a null value.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/8b2c494b42760a5f10b21629c4436c6c47526a0b

Comment by Robert Stam [ 10/Feb/13 ]

Handle null keys also.

Generated at Wed Feb 07 21:37:31 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.