Skip to content

Commit

Permalink
fix: added validation to avoid nil pointer error
Browse files Browse the repository at this point in the history
  • Loading branch information
PacoDw committed May 11, 2020
1 parent 71adf36 commit a9a4dd6
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 @@ -523,7 +523,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 @@ -550,7 +549,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 a9a4dd6

Please sign in to comment.