fixed nil check in resourceArmVirtualMachineStorageOsDiskHash

This commit is contained in:
Brandon Tosch 2017-03-01 18:32:03 -08:00
parent 909976eebe
commit 00df2204a2
1 changed files with 5 additions and 3 deletions

View File

@ -808,9 +808,11 @@ func resourceArmVirtualMachineStorageOsDiskHash(v interface{}) int {
if m["vhd_uri"] != nil {
buf.WriteString(fmt.Sprintf("%s-", m["vhd_uri"].(string)))
}
managedDisk := m["managed_disk"].(map[string]interface{})
if managedDisk["storage_account_type"] != nil {
buf.WriteString(fmt.Sprintf("%s-", managedDisk["storage_account_type"].(string)))
if m["managed_disk"] != nil {
managedDisk := m["managed_disk"].(map[string]interface{})
if managedDisk["storage_account_type"] != nil {
buf.WriteString(fmt.Sprintf("%s-", managedDisk["storage_account_type"].(string)))
}
}
return hashcode.String(buf.String())
}