From e4137b2eeaaa4331d3ad6d90963794c31819babb Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 23 May 2022 21:16:00 -0700 Subject: [PATCH] imagetools: handle manifest with nil platform Signed-off-by: Tonis Tiigi --- util/imagetools/printers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/imagetools/printers.go b/util/imagetools/printers.go index 4a4ab621..3e973a86 100644 --- a/util/imagetools/printers.go +++ b/util/imagetools/printers.go @@ -59,7 +59,9 @@ func NewPrinter(ctx context.Context, opt Opt, name string, format string) (*Prin switch manifest.MediaType { case images.MediaTypeDockerSchema2ManifestList, ocispecs.MediaTypeImageIndex: for _, m := range index.Manifests { - pforms = append(pforms, *m.Platform) + if m.Platform != nil { + pforms = append(pforms, *m.Platform) + } } default: pforms = append(pforms, platforms.DefaultSpec())