From 55aa2c0728bb61be6170fe12f7b78be07b454c4f Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 28 Nov 2022 14:37:40 -0800 Subject: [PATCH] Fix crash around azurerm_windows_virtual_machine_scale_set --- .../compute/windows_virtual_machine_scale_set_resource.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/services/compute/windows_virtual_machine_scale_set_resource.go b/internal/services/compute/windows_virtual_machine_scale_set_resource.go index dfbe406d7d6a..bb8015cd3be0 100644 --- a/internal/services/compute/windows_virtual_machine_scale_set_resource.go +++ b/internal/services/compute/windows_virtual_machine_scale_set_resource.go @@ -531,8 +531,9 @@ func resourceWindowsVirtualMachineScaleSetUpdate(d *pluginsdk.ResourceData, meta upgradePolicy.AutomaticOSUpgradePolicy = ExpandVirtualMachineScaleSetAutomaticUpgradePolicy(automaticRaw) // however if this block has been changed then we need to pull it - // we can guarantee this always has a value since it'll have been expanded and thus is safe to de-ref - automaticOSUpgradeIsEnabled = *upgradePolicy.AutomaticOSUpgradePolicy.EnableAutomaticOSUpgrade + if upgradePolicy.AutomaticOSUpgradePolicy != nil && upgradePolicy.AutomaticOSUpgradePolicy.EnableAutomaticOSUpgrade != nil { + automaticOSUpgradeIsEnabled = *upgradePolicy.AutomaticOSUpgradePolicy.EnableAutomaticOSUpgrade + } } if d.HasChange("rolling_upgrade_policy") {