Skip to content

Commit

Permalink
Add check for Environment proto field before accessing in Dataflow pr…
Browse files Browse the repository at this point in the history
  • Loading branch information
jrmccluskey authored and Charles Leon committed Feb 29, 2024
1 parent f2148cb commit 11b54d8
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,9 @@ func resourceDataflowJobRead(d *schema.ResourceData, meta interface{}) error {
if err := d.Set("effective_labels", job.Labels); err != nil {
return fmt.Errorf("Error setting effective_labels: %s", err)
}
if job.Environment == nil {
return fmt.Errorf("Error accessing Environment proto: proto is nil")
}
if err := d.Set("kms_key_name", job.Environment.ServiceKmsKeyName); err != nil {
return fmt.Errorf("Error setting kms_key_name: %s", err)
}
Expand Down

0 comments on commit 11b54d8

Please sign in to comment.