Skip to content

Commit 7d91245

Browse files
committed
CSHARP-1546: Set CurrentElementName to null instead of "?" when SkipName is called.
1 parent 2d20c9b commit 7d91245

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/MongoDB.Bson/IO/BsonBinaryReader.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -674,7 +674,7 @@ public override void SkipName()
674674
}
675675

676676
_bsonStream.SkipCString();
677-
CurrentName = "?";
677+
CurrentName = null;
678678
State = BsonReaderState.Value;
679679

680680
if (_context.ContextType == ContextType.Document)
@@ -773,7 +773,7 @@ private string GenerateDottedElementName(BsonBinaryReaderContext context, string
773773
{
774774
if (context.ContextType == ContextType.Document)
775775
{
776-
return GenerateDottedElementName(context.ParentContext, context.CurrentElementName + "." + elementName);
776+
return GenerateDottedElementName(context.ParentContext, (context.CurrentElementName ?? "?") + "." + elementName);
777777
}
778778
else if (context.ContextType == ContextType.Array)
779779
{

0 commit comments

Comments
 (0)