Skip to content

Commit 0ba6a40

Browse files
authored
Fix seg fault when node.Items is nil (#20)
1 parent 79a92c8 commit 0ba6a40

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

pkg/opentofu/schematotofu.go

+4-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ func typeExprTokens(node *schema.Schema, optional bool) hclwrite.Tokens {
8383
}
8484

8585
func convertArray(node *schema.Schema) hclwrite.Tokens {
86-
return hclwrite.TokensForFunctionCall("list", typeExprTokens(node.Items, false))
86+
if node.Items != nil {
87+
return hclwrite.TokensForFunctionCall("list", typeExprTokens(node.Items, false))
88+
}
89+
return hclwrite.TokensForFunctionCall("list", hclwrite.TokensForIdentifier("any"))
8790
}
8891

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

0 commit comments

Comments
 (0)