Skip to content

Commit 4f3b0a8

Browse files
committed
Merge branch 'pr/123'
Change-Id: Ic6ebfb2610227e24a970e50c4664a10a478d2bf3
2 parents c10d76a + 4d33682 commit 4f3b0a8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

mongo/single_result.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ type SingleResult struct {
3333
// will be returned. If there were no returned documents, ErrNoDocuments is
3434
// returned.
3535
func (sr *SingleResult) Decode(v interface{}) error {
36+
if sr.err != nil {
37+
return sr.err
38+
}
3639
if sr.reg == nil {
3740
return bson.ErrNilRegistry
3841
}
3942
switch {
40-
case sr.err != nil:
41-
return sr.err
4243
case sr.rdr != nil:
4344
if v == nil {
4445
return nil

0 commit comments

Comments
 (0)