Skip to content

Commit

Permalink
🐛 terraform: avoid nil crash on non-existent block in module (#3433)
Browse files Browse the repository at this point in the history
Fixes #3377

Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus authored Feb 27, 2024
1 parent a6243ff commit 5c3ae3a
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions providers/terraform/resources/hcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,11 @@ func (t *mqlTerraformModule) block() (*mqlTerraformBlock, error) {
}
}

if mqlHclBlock == nil {
t.Block.State = plugin.StateIsNull | plugin.StateIsSet
return nil, nil
}

return mqlHclBlock, nil
}

Expand Down

0 comments on commit 5c3ae3a

Please sign in to comment.