mirror of https://github.com/status-im/consul.git
fix(peering): nil pointer in calling handleUpdateService (#15160)
* fix(peering): nil pointer in calling handleUpdateService * changelog
This commit is contained in:
parent
e5130be812
commit
a9427e1310
|
@ -0,0 +1,3 @@
|
|||
```release-note:bug
|
||||
peering: fix nil pointer in calling handleUpdateService
|
||||
```
|
|
@ -287,7 +287,6 @@ func (s *Server) handleUpsertExportedServiceList(
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for _, sn := range serviceList {
|
||||
if _, ok := exportedServices[sn]; !ok {
|
||||
err := s.handleUpdateService(peerName, partition, sn, nil)
|
||||
|
@ -324,9 +323,12 @@ func (s *Server) handleUpdateService(
|
|||
return fmt.Errorf("failed to read imported services: %w", err)
|
||||
}
|
||||
|
||||
structsNodes, err := export.CheckServiceNodesToStruct()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to convert protobuf instances to structs: %w", err)
|
||||
structsNodes := []structs.CheckServiceNode{}
|
||||
if export != nil {
|
||||
structsNodes, err = export.CheckServiceNodesToStruct()
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to convert protobuf instances to structs: %w", err)
|
||||
}
|
||||
}
|
||||
|
||||
// Normalize the data into a convenient form for operation.
|
||||
|
|
Loading…
Reference in New Issue