Skip to content

Commit

Permalink
r/mssql_elasticpool: fixing a crash when sku was nil (#5017)
Browse files Browse the repository at this point in the history
Fixes #5003
  • Loading branch information
tombuildsstuff authored and katbyte committed Nov 28, 2019
1 parent 42bdd9c commit f05118b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions azurerm/resource_arm_mssql_elasticpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,22 +387,26 @@ func expandAzureRmMsSqlElasticPoolSku(d *schema.ResourceData) *sql.Sku {
}
}

func flattenAzureRmMsSqlElasticPoolSku(resp *sql.Sku) []interface{} {
func flattenAzureRmMsSqlElasticPoolSku(input *sql.Sku) []interface{} {
if input == nil {
return []interface{}{}
}

values := map[string]interface{}{}

if name := resp.Name; name != nil {
if name := input.Name; name != nil {
values["name"] = *name
}

if tier := resp.Tier; tier != nil {
if tier := input.Tier; tier != nil {
values["tier"] = *tier
}

if family := resp.Family; family != nil {
if family := input.Family; family != nil {
values["family"] = *family
}

if capacity := resp.Capacity; capacity != nil {
if capacity := input.Capacity; capacity != nil {
values["capacity"] = *capacity
}

Expand Down

0 comments on commit f05118b

Please sign in to comment.