Dont crash in the testutil server creation (#6516)

pull/6517/head
Matt Keeler 5 years ago committed by GitHub
parent 51dcd126b7
commit 6d4930da93
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -264,7 +264,10 @@ func newTestServerConfigT(t *testing.T, cb ServerConfigCallback) (*TestServer, e
return nil, errors.Wrap(err, "failed marshaling json")
}
t.Logf("CONFIG JSON: %s", string(b))
if t != nil {
// if you really want this output ensure to pass a valid t
t.Logf("CONFIG JSON: %s", string(b))
}
configFile := filepath.Join(tmpdir, "config.json")
if err := ioutil.WriteFile(configFile, b, 0644); err != nil {
cfg.ReturnPorts()

Loading…
Cancel
Save