diff --git a/.changelog/6835.txt b/.changelog/6835.txt new file mode 100644 index 00000000000..7091edd9cc3 --- /dev/null +++ b/.changelog/6835.txt @@ -0,0 +1,3 @@ +```release-note:bug +storage: fixed a crash when `log_bucket` is updated with empty body on `google_storage_bucket` +``` diff --git a/google/resource_storage_bucket.go b/google/resource_storage_bucket.go index 8fcd3ed5fd4..c3a936222a3 100644 --- a/google/resource_storage_bucket.go +++ b/google/resource_storage_bucket.go @@ -963,7 +963,7 @@ func expandBucketDataLocations(configured interface{}) []string { func expandBucketLogging(configured interface{}) *storage.BucketLogging { loggings := configured.([]interface{}) - if len(loggings) == 0 { + if len(loggings) == 0 || loggings[0] == nil { return nil }