Skip to content

Commit

Permalink
google_storage_bucket: Initialize website struct (#3686)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician authored and danawillow committed May 22, 2019
1 parent a20d2eb commit 8b3142e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion google/resource_storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -389,14 +389,15 @@ func resourceStorageBucketUpdate(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("At most one website block is allowed")
}

sb.Website = &storage.BucketWebsite{}

// Setting fields to "" to be explicit that the PATCH call will
// delete this field.
if len(websites) == 0 || websites[0] == nil {
sb.Website.NotFoundPage = ""
sb.Website.MainPageSuffix = ""
} else {
website := websites[0].(map[string]interface{})
sb.Website = &storage.BucketWebsite{}
if v, ok := website["not_found_page"]; ok {
sb.Website.NotFoundPage = v.(string)
} else {
Expand Down

0 comments on commit 8b3142e

Please sign in to comment.