修复DelSessByStoken的panic问题

This commit is contained in:
bjdgyc 2022-11-07 17:16:32 +08:00
parent 87dcc63b6f
commit 50c30657ac
1 changed files with 7 additions and 2 deletions

View File

@ -417,7 +417,10 @@ func CloseSess(token string) {
delete(sessions, token)
delete(dtlsIds, sess.DtlsSid)
sess.CSess.Close()
if sess.CSess != nil {
sess.CSess.Close()
}
}
func CloseCSess(token string) {
@ -428,7 +431,9 @@ func CloseCSess(token string) {
return
}
sess.CSess.Close()
if sess.CSess != nil {
sess.CSess.Close()
}
}
func DelSessByStoken(stoken string) {