From 3a30b2ecdaee91430ad942c16c67d44a456c95d3 Mon Sep 17 00:00:00 2001 From: Bradley Jones Date: Tue, 6 Aug 2024 10:11:08 +0000 Subject: [PATCH] fix: check for nil pointer when imageDigest is not found Signed-off-by: Bradley Jones --- pkg/inventory/ecs.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/inventory/ecs.go b/pkg/inventory/ecs.go index c884192..b71a1c1 100644 --- a/pkg/inventory/ecs.go +++ b/pkg/inventory/ecs.go @@ -123,7 +123,9 @@ func buildContainerTagMap(tasks []*ecs.Task) map[string]string { // check if the container tag consists of an @ symbol if !strings.Contains(*container.Image, "@") { // Good tag image, store map - containerMap[*container.ImageDigest] = *container.Image + if container.ImageDigest != nil { + containerMap[*container.ImageDigest] = *container.Image + } } } }