From b5e858d3e1be1145689e772fc3403f0f07e355ee Mon Sep 17 00:00:00 2001 From: freddygv Date: Thu, 30 Jul 2020 11:13:40 -0600 Subject: [PATCH] Avoid panics during shutdown routine --- agent/consul/server.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/agent/consul/server.go b/agent/consul/server.go index 8482ba225e..7eccbae81e 100644 --- a/agent/consul/server.go +++ b/agent/consul/server.go @@ -958,9 +958,13 @@ func (s *Server) Shutdown() error { } // Close the connection pool - s.connPool.Shutdown() + if s.connPool != nil { + s.connPool.Shutdown() + } - s.acls.Close() + if s.acls != nil { + s.acls.Close() + } if s.config.NotifyShutdown != nil { s.config.NotifyShutdown()