Skip to content

Commit

Permalink
Fix BadgerDB impl returns error when a key is not found
Browse files Browse the repository at this point in the history
- Fix after noticing the error after the test fix (see previous commit)

Related to #16
  • Loading branch information
philippgille committed Nov 7, 2018
1 parent 99f147c commit 1790db3
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions badgerdb/badgerdb.go
Expand Up @@ -48,13 +48,11 @@ func (c Store) Get(k string, v interface{}) (bool, error) {
}
return nil
})
if err != nil {
return false, err
}

// If no value was found return false
if data == nil {
if err == badger.ErrKeyNotFound {
return false, nil
} else if err != nil {
return false, err
}

return true, util.FromJSON(data, v)
Expand Down

0 comments on commit 1790db3

Please sign in to comment.