diff --git a/cty/convert/conversion_object.go b/cty/convert/conversion_object.go index 51958ef4..2d556961 100644 --- a/cty/convert/conversion_object.go +++ b/cty/convert/conversion_object.go @@ -80,7 +80,7 @@ func conversionObjectToObject(in, out cty.Type, unsafe bool) conversion { } } - if val.IsNull() { + if val.IsNull() && val != cty.NilVal { // Strip optional attributes out of the embedded type for null // values. val = cty.NullVal(val.Type().WithoutOptionalAttributesDeep())