Skip to content

Commit

Permalink
Fix seg fault when node.Items is nil (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
mclacore authored Nov 27, 2024
1 parent 79a92c8 commit 0ba6a40
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pkg/opentofu/schematotofu.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ func typeExprTokens(node *schema.Schema, optional bool) hclwrite.Tokens {
}

func convertArray(node *schema.Schema) hclwrite.Tokens {
return hclwrite.TokensForFunctionCall("list", typeExprTokens(node.Items, false))
if node.Items != nil {
return hclwrite.TokensForFunctionCall("list", typeExprTokens(node.Items, false))
}
return hclwrite.TokensForFunctionCall("list", hclwrite.TokensForIdentifier("any"))
}

func convertMap(node *schema.Schema) hclwrite.Tokens {
Expand Down

0 comments on commit 0ba6a40

Please sign in to comment.