fix nil dereference: check that httpServer is set before shutting down
@@ -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 {
