Skip to content

Commit bc0b75f

Browse files
fixed - checking the length of the right variable (#4227) (#2723)
* fixed-checking the length of the right variable * lenght check added begining of the function as per PR comments Signed-off-by: Modular Magician <[email protected]>
1 parent 22f1a7b commit bc0b75f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.changelog/4227.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
```release-note:none
2+
```

google-beta/resource_storage_bucket.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,10 +843,10 @@ func resourceStorageBucketStateImporter(d *schema.ResourceData, meta interface{}
843843
}
844844

845845
func expandCors(configured []interface{}) []*storage.BucketCors {
846-
corsRules := make([]*storage.BucketCors, 0, len(configured))
847-
if len(corsRules) == 0 {
846+
if len(configured) == 0 {
848847
return nil
849848
}
849+
corsRules := make([]*storage.BucketCors, 0, len(configured))
850850
for _, raw := range configured {
851851
data := raw.(map[string]interface{})
852852
corsRule := storage.BucketCors{

0 commit comments

Comments
 (0)