mirror of
https://github.com/moby/moby.git
synced 2026-08-07 00:21:52 +00:00
Merge pull request #47734 from krissetto/image-history-timestamp-dereference
fix: avoid nil dereference on image history `Created` value
This commit is contained in:
@@ -43,9 +43,14 @@ func (i *ImageService) ImageHistory(ctx context.Context, name string) ([]*image.
|
||||
layerCounter++
|
||||
}
|
||||
|
||||
var created int64
|
||||
if h.Created != nil {
|
||||
created = h.Created.Unix()
|
||||
}
|
||||
|
||||
history = append([]*image.HistoryResponseItem{{
|
||||
ID: "<missing>",
|
||||
Created: h.Created.Unix(),
|
||||
Created: created,
|
||||
CreatedBy: h.CreatedBy,
|
||||
Comment: h.Comment,
|
||||
Size: layerSize,
|
||||
|
||||
Reference in New Issue
Block a user