From d7a73937eb847a63a3a11c33ea409a8bd0e6efaf Mon Sep 17 00:00:00 2001 From: clint shryock Date: Mon, 14 Dec 2015 14:41:54 -0600 Subject: [PATCH] provider/aws: Guard against nil DB Parameter vaules --- builtin/providers/aws/structure.go | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/builtin/providers/aws/structure.go b/builtin/providers/aws/structure.go index b5ca83a79..748ecc88b 100644 --- a/builtin/providers/aws/structure.go +++ b/builtin/providers/aws/structure.go @@ -399,10 +399,16 @@ func flattenEcsContainerDefinitions(definitions []*ecs.ContainerDefinition) (str func flattenParameters(list []*rds.Parameter) []map[string]interface{} { result := make([]map[string]interface{}, 0, len(list)) for _, i := range list { - result = append(result, map[string]interface{}{ - "name": strings.ToLower(*i.ParameterName), - "value": strings.ToLower(*i.ParameterValue), - }) + if i.ParameterName != nil { + r := make(map[string]interface{}) + 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 }