Skip to content

Commit

Permalink
fix: handle null values better when looking at a list (#1011)
Browse files Browse the repository at this point in the history
Signed-off-by: Owen Rumney <[email protected]>

Signed-off-by: Owen Rumney <[email protected]>
  • Loading branch information
Owen Rumney authored Oct 17, 2022
1 parent 73b6a55 commit ff25ebc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/terraform/attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,10 @@ func (a *Attribute) listContains(val cty.Value, stringToLookFor string, ignoreCa

valueSlice := val.AsValueSlice()
for _, value := range valueSlice {
if value.IsNull() || !value.IsKnown() {
// there is nothing we can do with this value
continue
}
stringToTest := value
if value.Type().IsObjectType() || value.Type().IsMapType() {
valueMap := value.AsValueMap()
Expand Down

0 comments on commit ff25ebc

Please sign in to comment.