mirror of https://github.com/hashicorp/consul
added nil check for map
parent
b3e2ec1cca
commit
8d0e9a5490
|
@ -137,6 +137,9 @@ RPC:
|
|||
// If not, get it from mapAddrVer.
|
||||
if _, ok := info.Meta[structs.MetaConsulVersion]; !ok {
|
||||
if _, okver := mapAddrVer[info.Address]; okver {
|
||||
if info.Meta == nil {
|
||||
info.Meta = make(map[string]string)
|
||||
}
|
||||
info.Meta[structs.MetaConsulVersion] = mapAddrVer[info.Address]
|
||||
}
|
||||
}
|
||||
|
@ -159,6 +162,9 @@ RPC:
|
|||
// If not, get it from mapAddrVer.
|
||||
if _, ok := info.Meta[structs.MetaConsulVersion]; !ok {
|
||||
if _, okver := mapAddrVer[info.Address]; okver {
|
||||
if info.Meta == nil {
|
||||
info.Meta = make(map[string]string)
|
||||
}
|
||||
info.Meta[structs.MetaConsulVersion] = mapAddrVer[info.Address]
|
||||
}
|
||||
}
|
||||
|
@ -265,6 +271,9 @@ RPC:
|
|||
// If not, get it from mapAddrVer.
|
||||
if _, ok := info.Meta[structs.MetaConsulVersion]; !ok {
|
||||
if _, okver := mapAddrVer[info.Address]; okver {
|
||||
if info.Meta == nil {
|
||||
info.Meta = make(map[string]string)
|
||||
}
|
||||
info.Meta[structs.MetaConsulVersion] = mapAddrVer[info.Address]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue