From f58b613ef4dbeac57663ad3974abd870677ff929 Mon Sep 17 00:00:00 2001 From: Steph Date: Fri, 8 Dec 2023 08:43:53 +0100 Subject: [PATCH] nil check first element of additional capabilities slice --- internal/services/legacy/virtual_machine_resource.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/services/legacy/virtual_machine_resource.go b/internal/services/legacy/virtual_machine_resource.go index 176e20bd1b63..451b7ba66283 100644 --- a/internal/services/legacy/virtual_machine_resource.go +++ b/internal/services/legacy/virtual_machine_resource.go @@ -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 }