From 81f2ce48330d6c8c5188aac36cdaa73d36cba47b Mon Sep 17 00:00:00 2001 From: Christoph Hartmann Date: Mon, 27 May 2024 20:51:39 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20handle=20case=20where=20template?= =?UTF-8?q?=20node=20has=20no=20content?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/cloudformation/resources/template.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/providers/cloudformation/resources/template.go b/providers/cloudformation/resources/template.go index 884da63c3b..a8811c4a19 100644 --- a/providers/cloudformation/resources/template.go +++ b/providers/cloudformation/resources/template.go @@ -55,6 +55,11 @@ func (r *mqlCloudformationTemplate) id() (string, error) { func (r *mqlCloudformationTemplate) extractDict(section cft.Section) (map[string]interface{}, error) { conn := r.MqlRuntime.Connection.(*connection.CloudformationConnection) template := conn.CftTemplate() + + if template.Node == nil || len(template.Node.Content) == 0 { + return nil, nil + } + _, parameters, err := gatherMapValue(template.Node.Content[0], string(section)) if err != nil && status.Code(err) == codes.NotFound { return nil, nil