Prevent nil pointer panic when server response is incorrect under CDN mode

This commit is contained in:
Andy Wang 2020-09-07 14:47:37 +01:00
parent 80df86c773
commit cfbdd9a608
1 changed files with 7 additions and 0 deletions

View File

@ -62,3 +62,10 @@ func (ws *WSOverTLS) Handshake(rawConn net.Conn, authInfo AuthInfo) (sessionKey
return
}
func (ws *WSOverTLS) Close() error {
if ws.WebSocketConn != nil {
return ws.WebSocketConn.Close()
}
return nil
}