provider/aws: Guard against nil DB Parameter vaules

This commit is contained in:
clint shryock 2015-12-14 14:41:54 -06:00
parent 86882e39ed
commit d7a73937eb
1 changed files with 10 additions and 4 deletions

View File

@ -399,10 +399,16 @@ func flattenEcsContainerDefinitions(definitions []*ecs.ContainerDefinition) (str
func flattenParameters(list []*rds.Parameter) []map[string]interface{} { func flattenParameters(list []*rds.Parameter) []map[string]interface{} {
result := make([]map[string]interface{}, 0, len(list)) result := make([]map[string]interface{}, 0, len(list))
for _, i := range list { for _, i := range list {
result = append(result, map[string]interface{}{ if i.ParameterName != nil {
"name": strings.ToLower(*i.ParameterName), r := make(map[string]interface{})
"value": strings.ToLower(*i.ParameterValue), r["name"] = strings.ToLower(*i.ParameterName)
}) // Default empty string, guard against nil parameter values
r["value"] = ""
if i.ParameterValue != nil {
r["value"] = strings.ToLower(*i.ParameterValue)
}
result = append(result, r)
}
} }
return result return result
} }