Fix nil pointer on test
This commit is contained in:
parent
0da8fa412d
commit
4785e56283
|
@ -1065,7 +1065,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
|
|||
}
|
||||
}
|
||||
|
||||
if !opts.SkipInit {
|
||||
if opts != nil && !opts.SkipInit {
|
||||
keys, root := TestCoreInitClusterWrapperSetup(t, cores[0], clusterAddrGen(listeners[0]), handlers[0])
|
||||
barrierKeys, _ := copystructure.Copy(keys)
|
||||
testCluster.BarrierKeys = barrierKeys.([][]byte)
|
||||
|
@ -1159,7 +1159,7 @@ func NewTestCluster(t testing.T, base *CoreConfig, opts *TestClusterOptions) *Te
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if !opts.SkipInit {
|
||||
if opts != nil && !opts.SkipInit {
|
||||
apiClient.SetToken(testCluster.RootToken)
|
||||
}
|
||||
return apiClient
|
||||
|
|
Loading…
Reference in a new issue