Skip to content
This repository has been archived by the owner on Nov 1, 2022. It is now read-only.

Commit

Permalink
Fix index-range panic
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbellamy committed Jan 19, 2017
1 parent f94fd3e commit a6a0439
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions registry/registry.go
Expand Up @@ -200,9 +200,11 @@ func (c *client) lookupImage(client backend, lookupName, imageName, tag string)
Created time.Time `json:"created"`
}
var topmost v1image
if err = json.Unmarshal([]byte(history[0].V1Compatibility), &topmost); err == nil {
if !topmost.Created.IsZero() {
img.CreatedAt = &topmost.Created
if len(history) > 0 {
if err = json.Unmarshal([]byte(history[0].V1Compatibility), &topmost); err == nil {
if !topmost.Created.IsZero() {
img.CreatedAt = &topmost.Created
}
}
}

Expand Down

0 comments on commit a6a0439

Please sign in to comment.