소스 검색

AWS SDK seems to add nil objects to slice

Mohammed Nafees 3 년 전
부모
커밋
52f6a5fabe
1개의 변경된 파일8개의 추가작업 그리고 0개의 파일을 삭제
  1. 8 0
      internal/registry/registry.go

+ 8 - 0
internal/registry/registry.go

@@ -707,6 +707,10 @@ func (r *Registry) GetECRPaginatedImages(
 	imageIDMap := make(map[string]bool)
 
 	for _, id := range resp.ImageIds {
+		if id == nil {
+			continue
+		}
+
 		imageIDMap[*id.ImageTag] = true
 	}
 
@@ -746,6 +750,10 @@ func (r *Registry) GetECRPaginatedImages(
 	imageInfoMap := make(map[string]*ptypes.Image)
 
 	for _, img := range imageDetails {
+		if img == nil {
+			continue
+		}
+
 		for _, tag := range img.ImageTags {
 			newImage := &ptypes.Image{
 				Digest:         *img.ImageDigest,