Skip to content

Commit

Permalink
testutils: Avoid a panic when a Get returns nil.
Browse files Browse the repository at this point in the history
Signed-off-by: Matthieu Nottale <[email protected]>
  • Loading branch information
Matthieu Nottale committed Aug 9, 2017
1 parent 3a5aafd commit 18a2759
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions testutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ func testPutGetDeleteExists(t *testing.T, kv store.Store) {
assert.NoError(t, err, failMsg)
if assert.NotNil(t, pair, failMsg) {
assert.NotNil(t, pair.Value, failMsg)
assert.Equal(t, pair.Value, value, failMsg)
assert.NotEqual(t, pair.LastIndex, 0, failMsg)
}
assert.Equal(t, pair.Value, value, failMsg)
assert.NotEqual(t, pair.LastIndex, 0, failMsg)

// Exists should return true
exists, err := kv.Exists(key)
Expand Down

0 comments on commit 18a2759

Please sign in to comment.