fix nil dereference in benchmarks.

This commit is contained in:
Raúl Kripalani 2018-08-31 13:30:13 +01:00
parent 039ee3a7b1
commit 580527bc73

View File

@ -42,9 +42,12 @@ func TestPeerstore(t *testing.T, factory PeerstoreFactory) {
func BenchmarkPeerstore(b *testing.B, factory PeerstoreFactory) {
ps, closeFunc := factory()
defer closeFunc()
b.Run("Peerstore", benchmarkPeerstore(ps))
if closeFunc != nil {
closeFunc()
}
}
func testAddrStream(ps pstore.Peerstore) func(t *testing.T) {