Skip to content

Commit

Permalink
null check in ValueMarks
Browse files Browse the repository at this point in the history
  • Loading branch information
jbardin committed May 6, 2021
1 parent 5f30efe commit d76a8fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions configs/configschema/marks.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
4 changes: 4 additions & 0 deletions configs/configschema/marks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit d76a8fc

Please sign in to comment.