Skip to content

Commit 25e8af1

Browse files
committed
Bugfix CreateCollection doesn't return and throws NullReferenceException
1 parent 9a12e4a commit 25e8af1

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/MongoDB.Driver/MongoDatabaseImpl.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,14 @@ public override void CreateCollection(string name, CreateCollectionOptions optio
7373
if (options == null)
7474
{
7575
CreateCollectionHelper<BsonDocument>(name, null, cancellationToken);
76+
return;
7677
}
7778

7879
if (options.GetType() == typeof(CreateCollectionOptions))
7980
{
8081
var genericOptions = CreateCollectionOptions<BsonDocument>.CoercedFrom(options);
8182
CreateCollectionHelper<BsonDocument>(name, genericOptions, cancellationToken);
83+
return;
8284
}
8385

8486
var genericMethodDefinition = typeof(MongoDatabaseImpl).GetMethod("CreateCollectionHelper", BindingFlags.NonPublic | BindingFlags.Instance);

0 commit comments

Comments
 (0)