Skip to content

Commit

Permalink
Fix erroneous nil error return in FindOne.
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewdale committed Jan 30, 2025
1 parent 4e0ab11 commit 174671a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mongo/collection.go
Original file line number Diff line number Diff line change
Expand Up @@ -1551,7 +1551,7 @@ func (coll *Collection) FindOne(ctx context.Context, filter interface{},

args, err := mongoutil.NewOptions(opts...)
if err != nil {
return nil
return &SingleResult{err: err}
}
cursor, err := coll.find(ctx, filter, false, newFindArgsFromFindOneArgs(args))
return &SingleResult{
Expand Down

0 comments on commit 174671a

Please sign in to comment.