Skip to content

Commit

Permalink
Merge pull request #208 from pather87/master
Browse files Browse the repository at this point in the history
check if nic.NetworkInterfaceReferenceProperties.Primary field exists…
  • Loading branch information
tombuildsstuff authored Aug 4, 2017
2 parents 2976af2 + f25cbb5 commit 7e54df3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion azurerm/resource_arm_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ func resourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) err

if resp.VirtualMachineProperties.NetworkProfile.NetworkInterfaces != nil {
for _, nic := range *resp.VirtualMachineProperties.NetworkProfile.NetworkInterfaces {
if nic.NetworkInterfaceReferenceProperties != nil && *nic.NetworkInterfaceReferenceProperties.Primary {
if nic.NetworkInterfaceReferenceProperties != nil && nic.NetworkInterfaceReferenceProperties.Primary != nil && *nic.NetworkInterfaceReferenceProperties.Primary {
d.Set("primary_network_interface_id", nic.ID)
break
}
Expand Down

0 comments on commit 7e54df3

Please sign in to comment.