Skip to content

Commit

Permalink
🧹 handle case where template node has no content
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed May 27, 2024
1 parent a589abe commit 81f2ce4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/cloudformation/resources/template.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81f2ce4

Please sign in to comment.