null check in ValueMarks

pull/28624/head
James Bardin 5 years ago
parent 5f30efe857
commit d76a8fcf6c

@ -24,6 +24,9 @@ func (b *Block) ValueMarks(val cty.Value, path cty.Path) []cty.PathValueMarks {
}
}
if val.IsNull() {
return pvm
}
for name, blockS := range b.BlockTypes {
// If our block doesn't contain any sensitive attributes, skip inspecting it
if !blockS.Block.ContainsSensitive() {

@ -47,6 +47,10 @@ func TestBlockValueMarks(t *testing.T) {
cty.UnknownVal(schema.ImpliedType()),
cty.UnknownVal(schema.ImpliedType()),
},
{
cty.NullVal(schema.ImpliedType()),
cty.NullVal(schema.ImpliedType()),
},
{
cty.ObjectVal(map[string]cty.Value{
"sensitive": cty.UnknownVal(cty.String),

Loading…
Cancel
Save