From ab570ab3d62038b3d26f96a9bb585d0b6095b9b4 Mon Sep 17 00:00:00 2001 From: Christopher Petito <47751006+krissetto@users.noreply.github.com> Date: Fri, 19 Apr 2024 10:44:30 +0000 Subject: [PATCH] nil dereference fix on image history Created value Issue was caused by the changes here https://github.com/moby/moby/pull/45504 First released in v25.0.0-beta.1 Signed-off-by: Christopher Petito <47751006+krissetto@users.noreply.github.com> --- daemon/images/image_history.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/daemon/images/image_history.go b/daemon/images/image_history.go index 1617f8be62..f621ceae13 100644 --- a/daemon/images/image_history.go +++ b/daemon/images/image_history.go @@ -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: "", - Created: h.Created.Unix(), + Created: created, CreatedBy: h.CreatedBy, Comment: h.Comment, Size: layerSize,