Skip to content

Commit

Permalink
fixes a crash on updating log_bucket (#6835) (#13058)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes #13038

Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Nov 16, 2022
1 parent 615abbf commit c522bcf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .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`
```
2 changes: 1 addition & 1 deletion google/resource_storage_bucket.go
Expand Up @@ -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
}

Expand Down

0 comments on commit c522bcf

Please sign in to comment.