From d2ce7787dc40a3fcda67d91d1411abc407c7d5f6 Mon Sep 17 00:00:00 2001 From: Radek Simko Date: Fri, 8 Dec 2017 18:51:43 +0000 Subject: [PATCH] r/mq_broker: Fix crash in hashing function --- aws/resource_aws_mq_broker.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/aws/resource_aws_mq_broker.go b/aws/resource_aws_mq_broker.go index 0bbcd2d48b3..3589a52b8bf 100644 --- a/aws/resource_aws_mq_broker.go +++ b/aws/resource_aws_mq_broker.go @@ -386,7 +386,11 @@ func resourceAwsMqUserHash(v interface{}) int { var buf bytes.Buffer m := v.(map[string]interface{}) - buf.WriteString(fmt.Sprintf("%t-", m["console_access"].(bool))) + if ca, ok := m["console_access"]; ok { + buf.WriteString(fmt.Sprintf("%t-", ca.(bool))) + } else { + buf.WriteString("false-") + } if g, ok := m["groups"]; ok { buf.WriteString(fmt.Sprintf("%v-", g.(*schema.Set).List())) }