From d192dcfdd906be946730583c686ca2e628820e84 Mon Sep 17 00:00:00 2001 From: Pulak Kanti Bhowmick Date: Sun, 8 Dec 2024 20:17:38 +0600 Subject: [PATCH] Update pkg/list/list_components.go Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- pkg/list/list_components.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/list/list_components.go b/pkg/list/list_components.go index 565d93e00..057c75175 100644 --- a/pkg/list/list_components.go +++ b/pkg/list/list_components.go @@ -35,9 +35,13 @@ func getStackComponents(stackData any, listFields []string) ([]string, error) { for _, dataKey := range uniqueKeys { data := terraformComponents[dataKey] + dataMap, ok := data.(map[string]any) + if !ok { + return nil, fmt.Errorf("unexpected data type for component '%s'", dataKey) + } rowData := make([]string, 0) for _, key := range listFields { - value, found := resolveKey(data.(map[string]any), key) + value, found := resolveKey(dataMap, key) if !found { value = "-" }