Skip to content

Commit b43d9a9

Browse files
Merge pull request hashicorp#155 from modular-magician/codegen-pr-948
Add nil check to fix panic in storage bucket.
2 parents 9daf760 + d496f1f commit b43d9a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

google-beta/resource_storage_bucket.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ func resourceStorageBucketUpdate(d *schema.ResourceData, meta interface{}) error
358358

359359
// Setting fields to "" to be explicit that the PATCH call will
360360
// delete this field.
361-
if len(websites) == 0 {
361+
if len(websites) == 0 || websites[0] == nil {
362362
sb.Website.NotFoundPage = ""
363363
sb.Website.MainPageSuffix = ""
364364
} else {

0 commit comments

Comments
 (0)