diff --git a/socket/server.go b/socket/server.go index 4af2579..da2db52 100644 --- a/socket/server.go +++ b/socket/server.go @@ -602,7 +602,9 @@ func (s *Server) Close(fn func(error)) { if s.httpServer != nil { s.httpServer.Close(fn) } else { - s.engine.Close() + if s.engine != nil { + s.engine.Close() + } if fn != nil { fn(nil) }