mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-27 17:41:13 +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 {
|
if err != nil {
|
||||||
return "", err
|
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
|
return addr, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user