Skip to content

Commit 5e5ae23

Browse files
committed
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 <[email protected]>
1 parent f58fda9 commit 5e5ae23

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

client_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ func TestImagePullSomePlatforms(t *testing.T) {
293293

294294
found := false
295295
for _, matcher := range m {
296+
if manifest.Platform == nil {
297+
t.Fatal("manifest should have proper platform")
298+
}
296299
if matcher.Match(*manifest.Platform) {
297300
count++
298301
found = true

0 commit comments

Comments
 (0)