Skip to content

Commit

Permalink
add nil check to storagetransfer_job transfer schedule (#6634) (#12704)
Browse files Browse the repository at this point in the history
Signed-off-by: Modular Magician <magic-modules@google.com>

Signed-off-by: Modular Magician <magic-modules@google.com>
  • Loading branch information
modular-magician committed Oct 3, 2022
1 parent cba9e47 commit ed0ecf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .changelog/6634.txt
@@ -0,0 +1,3 @@
```release-note:bug
storagetransfer: fixed a crash in `google_storagetransfer_job` refreshes when `transfer_schedule` was empty
```
2 changes: 1 addition & 1 deletion google/resource_storage_transfer_job.go
Expand Up @@ -839,7 +839,7 @@ func expandTransferSchedules(transferSchedules []interface{}) *storagetransfer.S
}

func flattenTransferSchedule(transferSchedule *storagetransfer.Schedule) []map[string]interface{} {
if reflect.DeepEqual(transferSchedule, &storagetransfer.Schedule{}) {
if transferSchedule == nil || reflect.DeepEqual(transferSchedule, &storagetransfer.Schedule{}) {
return nil
}

Expand Down

0 comments on commit ed0ecf7

Please sign in to comment.