Skip to content

Commit

Permalink
updates mongodb driver for account store (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-moser authored Sep 19, 2019
1 parent 4829882 commit c5a0c53
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions account/store/mongo/mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ func (ms *MongoStore) LoadAccount(id string) (*store.AccountState, error) {
state := newaccountstate()
cursor := ms.coll.FindOne(ms.cnf.ContextProvider(), bson.D{{"_id", id}})
if err := cursor.Err(); err != nil {
return nil, err
}
if err := cursor.Decode(state); err != nil {
// return an empty account state object if there isn't
// a previously stored account
if err == mongo.ErrNoDocuments {
Expand All @@ -154,6 +151,9 @@ func (ms *MongoStore) LoadAccount(id string) (*store.AccountState, error) {
}
return nil, err
}
if err := cursor.Decode(state); err != nil {
return nil, err
}
return state.AccountState(), nil
}

Expand Down

0 comments on commit c5a0c53

Please sign in to comment.