Explorar o código

Merge pull request #2256 from porter-dev/nafees/hotfixes

[POR-603] [hotfix] Case on possible nil pointer value of `ImageTag` from ECR API response
abelanger5 %!s(int64=3) %!d(string=hai) anos
pai
achega
ada9c8f6f6
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      internal/registry/registry.go

+ 3 - 1
internal/registry/registry.go

@@ -707,7 +707,9 @@ func (r *Registry) GetECRPaginatedImages(
 	imageIDMap := make(map[string]bool)
 	imageIDMap := make(map[string]bool)
 
 
 	for _, id := range resp.ImageIds {
 	for _, id := range resp.ImageIds {
-		imageIDMap[*id.ImageTag] = true
+		if id != nil && id.ImageTag != nil {
+			imageIDMap[*id.ImageTag] = true
+		}
 	}
 	}
 
 
 	var wg sync.WaitGroup
 	var wg sync.WaitGroup