Pārlūkot izejas kodu

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>
Christopher Petito 1 gadu atpakaļ
vecāks
revīzija
ab570ab3d6
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6 1
      daemon/images/image_history.go

+ 6 - 1
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:        "<missing>",
-			Created:   h.Created.Unix(),
+			Created:   created,
 			CreatedBy: h.CreatedBy,
 			Comment:   h.Comment,
 			Size:      layerSize,