We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 934b076 commit aa842e9Copy full SHA for aa842e9
MongoDB.Bson/Serialization/BsonMemberMap.cs
@@ -338,6 +338,11 @@ public BsonMemberMap Reset()
338
/// <returns>The member map.</returns>
339
public BsonMemberMap SetDefaultValue(Func<object> defaultValueCreator)
340
{
341
+ if (defaultValueCreator == null)
342
+ {
343
+ throw new ArgumentNullException("defaultValueCreator");
344
+ }
345
+ if (_frozen) { ThrowFrozenException(); }
346
_defaultValue = defaultValueCreator(); // need an instance to compare against
347
_defaultValueCreator = defaultValueCreator;
348
_defaultValueSpecified = true;
0 commit comments