Skip to content

Commit

Permalink
nil check first element of additional capabilities slice (#24159)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephybun authored Dec 13, 2023
1 parent 1b09c90 commit a41a3a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/services/legacy/virtual_machine_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -1755,7 +1755,7 @@ func expandAzureRmVirtualMachineDiagnosticsProfile(d *pluginsdk.ResourceData) *c

func expandAzureRmVirtualMachineAdditionalCapabilities(d *pluginsdk.ResourceData) *compute.AdditionalCapabilities {
additionalCapabilities := d.Get("additional_capabilities").([]interface{})
if len(additionalCapabilities) == 0 {
if len(additionalCapabilities) == 0 || additionalCapabilities[0] == nil {
return nil
}

Expand Down

0 comments on commit a41a3a9

Please sign in to comment.