mirror of
https://github.com/moby/moby.git
synced 2026-08-09 01:21:37 +00:00
libnetwork/internal/kvstore/boltdb: BoltDB.Get(): don't shadow error
Don't shadow the original error if we got one. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -139,13 +139,12 @@ func (b *BoltDB) Get(key string) (*store.KVPair, error) {
|
||||
|
||||
return nil
|
||||
})
|
||||
|
||||
if len(val) == 0 {
|
||||
return nil, store.ErrKeyNotFound
|
||||
}
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(val) == 0 {
|
||||
return nil, store.ErrKeyNotFound
|
||||
}
|
||||
|
||||
dbIndex := binary.LittleEndian.Uint64(val[:libkvmetadatalen])
|
||||
val = val[libkvmetadatalen:]
|
||||
|
||||
Reference in New Issue
Block a user