Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-1485

NullReferenceException when saving an ExpandoObject property

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.13.0
    • Affects Version/s: 2.1.1
    • Component/s: Serialization
    • None
    • None
    • Fully Compatible
    • None
    • None
    • None
    • None
    • None
    • None

      I have a class like:

      	public class TagRecord
      	{
      		public Guid Id { get; set; }
      		....
      		public ExpandoObject ExtraData { get; set; }
      	}
      

      When I trying to insert it in MongoDb without setting ExtraData property (so leaving it to null) I get a NullReferenceException exception.
      If I simply change the type to "Object" all is working fine, also when I actually save it with an ExpandoObject instance.

            Assignee:
            james.kovacs@mongodb.com James Kovacs
            Reporter:
            davide.icardi@gmail.com Davide Icardi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: