provider/azurerm: `azurerm_virtual_machine` panic at UnattendConfig (#7453)

Guarding against `invalid memory address` in AdditionalUnattendConfig

```
make testacc TEST=./builtin/providers/azurerm TESTARGS='-run=TestAccAzureRMVirtualMachine_windowsUnattendedConfig'
==> Checking that code complies with gofmt requirements...
go generate $(go list ./... | grep -v /vendor/)
TF_ACC=1 go test ./builtin/providers/azurerm -v
-run=TestAccAzureRMVirtualMachine_windowsUnattendedConfig -timeout 120m
=== RUN   TestAccAzureRMVirtualMachine_windowsUnattendedConfig
--- PASS: TestAccAzureRMVirtualMachine_windowsUnattendedConfig (943.28s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm
943.299s
```
This commit is contained in:
Paul Stack 2016-07-03 11:31:35 +01:00 committed by GitHub
parent e812caa249
commit 421bda23b0
1 changed files with 4 additions and 1 deletions

View File

@ -730,7 +730,10 @@ func flattenAzureRmVirtualMachineOsProfileWindowsConfiguration(config *compute.W
c["pass"] = i.PassName
c["component"] = i.ComponentName
c["setting_name"] = i.SettingName
c["content"] = *i.Content
if i.Content != nil {
c["content"] = *i.Content
}
content = append(content, c)
}