fix nil dereference: check that httpServer is set before shutting down (#1893)
This commit is contained in:
parent
aa974d26c6
commit
66543493b5
|
@ -349,8 +349,10 @@ func (s *APIServer) Close() {
|
||||||
|
|
||||||
func (s *APIServer) Shutdown() error {
|
func (s *APIServer) Shutdown() error {
|
||||||
s.Close()
|
s.Close()
|
||||||
if err := s.httpServer.Shutdown(context.TODO()); err != nil {
|
if s.httpServer != nil {
|
||||||
return err
|
if err := s.httpServer.Shutdown(context.TODO()); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//close io.writer logger given to gin
|
//close io.writer logger given to gin
|
||||||
|
|
Loading…
Reference in a new issue