Skip to content

Commit

Permalink
better checking for null
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcervante committed Oct 19, 2022
1 parent bd2fd6b commit f49006e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cty/convert/conversion_object.go
Expand Up @@ -80,7 +80,9 @@ func conversionObjectToObject(in, out cty.Type, unsafe bool) conversion {
}
}

if val.Equals(cty.NullVal(val.Type())).True() {
if val.IsNull() {
// Strip optional attributes out of the embedded type for null
// values.
val = cty.NullVal(val.Type().WithoutOptionalAttributesDeep())
}

Expand Down

0 comments on commit f49006e

Please sign in to comment.