Skip to content

Commit

Permalink
Merge pull request #1723 from Shopify/empty-filter
Browse files Browse the repository at this point in the history
Handle missing/empty filter in terraform
  • Loading branch information
jacobbednarz committed Jun 27, 2022
2 parents f9b8260 + c65d96b commit 3d37ffb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/1723.txt
@@ -0,0 +1,3 @@
```release-note:bug
resource/cloudflare_logpush_job: fix unmarhalling job with empty/no filter
```
2 changes: 1 addition & 1 deletion internal/provider/resource_cloudflare_logpush_job.go
Expand Up @@ -72,7 +72,7 @@ func getJobFromResource(d *schema.ResourceData) (cloudflare.LogpushJob, *AccessI
}

filter := d.Get("filter")
if filter != nil {
if filter != "" {
var jobFilter cloudflare.LogpushJobFilters
if err := json.Unmarshal([]byte(filter.(string)), &jobFilter); err != nil {
return cloudflare.LogpushJob{}, identifier, err
Expand Down

0 comments on commit 3d37ffb

Please sign in to comment.