Skip to content

Commit

Permalink
added nil check for map
Browse files Browse the repository at this point in the history
  • Loading branch information
vijayraghav-io committed Jun 29, 2023
1 parent b3e2ec1 commit 8d0e9a5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions agent/ui_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand All @@ -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]
}
}
Expand Down Expand Up @@ -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]
}
}
Expand Down

0 comments on commit 8d0e9a5

Please sign in to comment.