Skip to content

Commit

Permalink
Merge pull request #373 from vmware/bangerar/fix-npe
Browse files Browse the repository at this point in the history
 Fix the NPE issue in provisioner resource/datasource
  • Loading branch information
ramya-bangera authored Jan 19, 2024
2 parents ee9e28b + 25c9eca commit 4dfb7a3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/resources/provisioner/data_source_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ func dataSourceProvisionerRead(ctx context.Context, d *schema.ResourceData, m in
_ = schema.RemoveFromState(d, m)
return
}

return
}

for i := range resp.Provisioners {
Expand All @@ -78,6 +80,7 @@ func dataSourceProvisionerRead(ctx context.Context, d *schema.ResourceData, m in
_ = schema.RemoveFromState(d, m)
return
}
return
}

d.SetId(resp.Provisioner.Meta.UID)
Expand Down
2 changes: 2 additions & 0 deletions internal/resources/provisioner/resource_provisioner.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ func resourceProvisionerRead(ctx context.Context, d *schema.ResourceData, m inte
_ = schema.RemoveFromState(d, m)
return
}

return
}

d.SetId(resp.Provisioner.Meta.UID)
Expand Down

0 comments on commit 4dfb7a3

Please sign in to comment.