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.
2 parents c10d76a + 4d33682 commit 4f3b0a8Copy full SHA for 4f3b0a8
mongo/single_result.go
@@ -33,12 +33,13 @@ type SingleResult struct {
33
// will be returned. If there were no returned documents, ErrNoDocuments is
34
// returned.
35
func (sr *SingleResult) Decode(v interface{}) error {
36
+ if sr.err != nil {
37
+ return sr.err
38
+ }
39
if sr.reg == nil {
40
return bson.ErrNilRegistry
41
}
42
switch {
- case sr.err != nil:
- return sr.err
43
case sr.rdr != nil:
44
if v == nil {
45
return nil
0 commit comments