Fix panic condition when no response is returned

This commit is contained in:
Dane Everitt 2022-01-31 18:37:02 -05:00
parent 0f9f80c181
commit 1e52ffef64

View File

@ -73,6 +73,9 @@ func (e *Environment) ContainerInspect(ctx context.Context) (types.ContainerJSON
res, err := e.client.HTTPClient().Do(req)
if err != nil {
if res == nil {
return st, errdefs.Unknown(err)
}
return st, errdefs.FromStatusCode(err, res.StatusCode)
}