From e54c990f50b02521616a573bbbf160d54b87c93b Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 23 Apr 2016 17:17:07 -0700 Subject: [PATCH] Detect type conversion failure --- physical/consul.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/physical/consul.go b/physical/consul.go index 4a639a982d..1ef63c3c11 100644 --- a/physical/consul.go +++ b/physical/consul.go @@ -511,7 +511,10 @@ func (c *ConsulBackend) DetectHostAddr() (string, error) { if err != nil { return "", err } - addr := self["Member"]["Addr"].(string) + addr, ok := self["Member"]["Addr"].(string) + if !ok { + return "", fmt.Errorf("Unable to convert an address to string") + } return addr, nil }