Skip to content

Commit

Permalink
Merge pull request #551 from terraform-providers/container-registry-c…
Browse files Browse the repository at this point in the history
…rash

Container Registry Migration: Fixing a crash when the storage_account block is nil
  • Loading branch information
tombuildsstuff authored Nov 13, 2017
2 parents 5bc8df7 + 7cd1513 commit 1d16342
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions azurerm/resource_arm_container_registry_migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,13 @@ func updateV1ToV2StorageAccountName(is *terraform.InstanceState, meta interface{
}

inputAccounts := result.Value.([]interface{})
inputAccount := inputAccounts[0].(map[string]interface{})
name := inputAccount["name"].(string)
inputAccount := inputAccounts[0]
if inputAccount == nil {
return nil
}

account := inputAccount.(map[string]interface{})
name := account["name"].(string)
storageAccountId, err := findAzureStorageAccountIdFromName(name, meta)
if err != nil {
return err
Expand Down

0 comments on commit 1d16342

Please sign in to comment.