From 5e5ae23d802c1a676de0a0c2e16701ef802e4de7 Mon Sep 17 00:00:00 2001 From: Li Yuxuan Date: Mon, 22 Jul 2019 20:36:24 +0800 Subject: [PATCH] test: Check manifest.Platform before dereferencing If the registry returns a manifest without platform info, the `manifest.Platform` will be `nil` and cause panic when dereferencing. Signed-off-by: Li Yuxuan --- client_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client_test.go b/client_test.go index f100f9c19..97776baaa 100644 --- a/client_test.go +++ b/client_test.go @@ -293,6 +293,9 @@ func TestImagePullSomePlatforms(t *testing.T) { found := false for _, matcher := range m { + if manifest.Platform == nil { + t.Fatal("manifest should have proper platform") + } if matcher.Match(*manifest.Platform) { count++ found = true