Check if Listener exists before trying to close it
the build was successful 详情

这个提交包含在:
Sarah Jamie Lewis 2020-10-29 15:45:07 -07:00
父节点 8af406a421
当前提交 ddc52c332f
共有 1 个文件被更改,包括 3 次插入1 次删除

查看文件

@ -172,7 +172,9 @@ func (s *BaseOnionService) Listen(app tapir.Application) error {
func (s *BaseOnionService) Shutdown() {
s.lock.Lock()
defer s.lock.Unlock()
s.ls.Close()
if s.ls != nil {
s.ls.Close()
}
s.connections.Range(func(key, value interface{}) bool {
connection := value.(tapir.Connection)
connection.Close()