Skip to content

Commit

Permalink
Merge pull request #122 from terraform-providers/fix-#118
Browse files Browse the repository at this point in the history
fix: added validation to avoid nil pointer error
  • Loading branch information
marinsalinas authored May 17, 2020
2 parents b78ab7e + a9a4dd6 commit 751ce8f
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nutanix/resource_nutanix_subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,6 @@ func resourceNutanixSubnetRead(d *schema.ResourceData, meta interface{}) error {

func resourceNutanixSubnetUpdate(d *schema.ResourceData, meta interface{}) error {
conn := meta.(*Client).API

request := &v3.SubnetIntentInput{}
metadata := &v3.Metadata{}
res := &v3.SubnetResources{}
Expand All @@ -541,7 +540,10 @@ func resourceNutanixSubnetUpdate(d *schema.ResourceData, meta interface{}) error

if response.Spec.Resources != nil {
res = response.Spec.Resources
ipcfg = res.IPConfig

if res.IPConfig != nil {
ipcfg = res.IPConfig
}
if ipcfg != nil {
dhcpO = ipcfg.DHCPOptions
}
Expand Down

0 comments on commit 751ce8f

Please sign in to comment.