Skip to content

Commit 306a8fe

Browse files
author
dimaspirit
committed
QBWEBSDK-186
1 parent 941f355 commit 306a8fe

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

js/modules/webrtc/qbWebRTCClient.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ WebRTCClient.prototype._onRejectListener = function(userID, sessionID, extension
190190
WebRTCClient.prototype._onStopListener = function(userID, sessionID, extension) {
191191
Helpers.trace("onStop. UserID:" + userID + ". SessionID: " + sessionID);
192192

193-
var session = this.sessions[sessionID];
194-
195-
if(session){
196-
var extensionClone = JSON.parse(JSON.stringify(extension));
193+
var session = this.sessions[sessionID],
194+
extensionClone = JSON.parse(JSON.stringify(extension));
195+
196+
if( session && (session.state === 1 || session.state === 2) ){
197197
this._cleanupExtension(extensionClone);
198198

199199
if (typeof this.onStopCallListener === 'function'){
@@ -202,7 +202,7 @@ WebRTCClient.prototype._onStopListener = function(userID, sessionID, extension)
202202

203203
session.processOnStop(userID, extension);
204204
}else{
205-
Helpers.traceError("Ignore 'onStop', there is no information about session " + sessionID + " by some reason.")
205+
Helpers.traceError("Ignore 'onStop', there is no information about session " + sessionID + " by some reason.");
206206
}
207207
};
208208

0 commit comments

Comments
 (0)