mirror of
https://github.com/m1k1o/neko.git
synced 2024-07-24 14:40:50 +12:00
destroy only if is WebRTC active.
This commit is contained in:
parent
feb07b97ab
commit
22407825fe
@ -123,9 +123,10 @@ func (session *SessionCtx) SetWebSocketConnected(connected bool) {
|
||||
session.manager.emmiter.Emit("disconnected", session)
|
||||
session.websocket_peer = nil
|
||||
|
||||
// TODO: Refactor. Only if is WebRTC active.
|
||||
if err := session.webrtc_peer.Destroy(); err != nil {
|
||||
session.logger.Warn().Err(err).Msgf("webrtc destroy has failed")
|
||||
if session.webrtc_peer != nil {
|
||||
if err := session.webrtc_peer.Destroy(); err != nil {
|
||||
session.logger.Warn().Err(err).Msgf("webrtc destroy has failed")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user