mirror of
https://github.com/docker/docs.git
synced 2026-04-12 14:25:46 +07:00
Merge pull request #7864 from unclejack/fix_panic_registry_session
registry/session: fix panic in GetRemoteImageLayer
This commit is contained in:
@@ -167,7 +167,9 @@ func (r *Session) GetRemoteImageLayer(imgID, registry string, token []string, im
|
||||
for i := 1; i <= retries; i++ {
|
||||
res, client, err = r.doRequest(req)
|
||||
if err != nil {
|
||||
res.Body.Close()
|
||||
if res.Body != nil {
|
||||
res.Body.Close()
|
||||
}
|
||||
if i == retries {
|
||||
return nil, fmt.Errorf("Server error: Status %d while fetching image layer (%s)",
|
||||
res.StatusCode, imgID)
|
||||
|
||||
Reference in New Issue
Block a user