Skip to content

Commit

Permalink
ds/default_tags: Placate semgrep
Browse files Browse the repository at this point in the history
  • Loading branch information
YakDriver committed May 21, 2021
1 parent 390dcad commit 0051a61
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions aws/data_source_aws_default_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ func dataSourceAwsDefaultTagsRead(d *schema.ResourceData, meta interface{}) erro

tags := defaultTagsConfig.GetTags()

if len(tags) > 0 {
tags = tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig)
}

if err := d.Set("tags", tags.Map()); err != nil {
return fmt.Errorf("error setting tags: %w", err)
if tags != nil {
if err := d.Set("tags", tags.IgnoreAws().IgnoreConfig(ignoreTagsConfig).Map()); err != nil {
return fmt.Errorf("error setting tags: %w", err)
}
} else {
d.Set("tags", nil)
}

return nil
Expand Down

0 comments on commit 0051a61

Please sign in to comment.