Skip to content

Commit

Permalink
r/virtual_machine: handling plan having no elements
Browse files Browse the repository at this point in the history
Fixes #4673
  • Loading branch information
tombuildsstuff committed Oct 24, 2019
1 parent 19adfc1 commit 189e34f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions azurerm/resource_arm_virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -1406,6 +1406,9 @@ func flattenAzureRmVirtualMachineReviseDiskInfo(result map[string]interface{}, d

func expandAzureRmVirtualMachinePlan(d *schema.ResourceData) (*compute.Plan, error) {
planConfigs := d.Get("plan").([]interface{})
if len(planConfigs) == 0 {
return nil, nil
}

planConfig := planConfigs[0].(map[string]interface{})

Expand Down

0 comments on commit 189e34f

Please sign in to comment.