mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-16 19:14:41 -07:00
Be safer on gw and sl access
Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
@@ -817,8 +817,15 @@ func (s *Server) initLeafNodeSmap(c *client) {
|
||||
gws := gwsa[:0]
|
||||
s.getOutboundGatewayConnections(&gws)
|
||||
for _, cgw := range gws {
|
||||
if ei, _ := cgw.gw.outsim.Load(accName); ei != nil {
|
||||
ei.(*outsie).sl.All(&subs)
|
||||
cgw.mu.Lock()
|
||||
gw := cgw.gw
|
||||
cgw.mu.Unlock()
|
||||
if gw != nil {
|
||||
if ei, _ := gw.outsim.Load(accName); ei != nil {
|
||||
if e := ei.(*outsie); e != nil && e.sl != nil {
|
||||
e.sl.All(&subs)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user