Skip to content

Commit

Permalink
fixes a crash on updating log_bucket (GoogleCloudPlatform#6835)
Browse files Browse the repository at this point in the history
Co-authored-by: Edward Sun <sunedward@google.com>
Fixes hashicorp/terraform-provider-google#13038
  • Loading branch information
edwardmedia authored and googlerjk committed Nov 25, 2022
1 parent 8d37e5b commit c285c74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -964,7 +964,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
2 changes: 1 addition & 1 deletion mmv1/third_party/validator/storage_bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func expandBucketEncryption(configured interface{}) *storage.BucketEncryption {

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 c285c74

Please sign in to comment.