Skip to content

Commit

Permalink
schemahcl: fix panic when eval invalid hcl (#3394)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu authored Feb 18, 2025
1 parent 8e3fee3 commit 6255f9f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion schemahcl/schemahcl.go
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ func (s *State) toAttrs(ctx *hcl.EvalContext, opts *EvalOptions, hclAttrs hclsyn
}
v = cty.CapsuleVal(ctyRefType, &Ref{V: v.GetAttr("__ref").AsString()})
}
if vt != cty.NilType && vt != v.Type() {
if vt != cty.NilType && !vt.Equals(v.Type()) {
return nil, fmt.Errorf("%s: mixed list types used in %q attribute", hclAttr.SrcRange, hclAttr.Name)
}
vt = v.Type()
Expand Down

0 comments on commit 6255f9f

Please sign in to comment.