mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 03:38:42 -07:00
[FIXED] Gateway: possible panic if monitor endpoint inspected too soon
The monitoring http server is started early and the gateway setup (when configured) may not be fully ready when the `/gatewayz` endpoint is inspected and could cause a panic. Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -1777,7 +1777,7 @@ func (s *Server) Gatewayz(opts *GatewayzOptions) (*Gatewayz, error) {
|
||||
now := time.Now().UTC()
|
||||
gw := s.gateway
|
||||
gw.RLock()
|
||||
if !gw.enabled {
|
||||
if !gw.enabled || gw.info == nil {
|
||||
gw.RUnlock()
|
||||
gwz := &Gatewayz{
|
||||
ID: srvID,
|
||||
|
||||
Reference in New Issue
Block a user