mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-27 09:31:10 +02:00
Detect type conversion failure
This commit is contained in:
parent
c92f9cb9ab
commit
e54c990f50
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user