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