diff --git a/entry/cli/server.go b/entry/cli/server.go index 18ed174..5bee47c 100644 --- a/entry/cli/server.go +++ b/entry/cli/server.go @@ -210,7 +210,9 @@ func (svr *Server) Shutdown() (err error) { if !atomic.CompareAndSwapInt32(&svr.exitFlag, 0, 1) { return } - err = svr.l.Close() + if svr.l != nil { + err = svr.l.Close() + } svr.ctxMap.Range(func(key, value any) bool { if ctx, ok := value.(*Context); ok { err = ctx.Close()