mirror of https://github.com/OpenVidu/openvidu.git
openvidu-browser: fix unexpected undefined exception on reconnected callback
parent
a852a826fa
commit
12f215ddd9
|
@ -1025,6 +1025,7 @@ export class OpenVidu {
|
|||
private reconnectedCallback(): void {
|
||||
logger.warn('Websocket reconnected');
|
||||
if (this.isRoomAvailable()) {
|
||||
if (!!this.session.connection) {
|
||||
this.sendRequest('connect', { sessionId: this.session.connection.rpcSessionId }, (error, response) => {
|
||||
if (!!error) {
|
||||
logger.error(error);
|
||||
|
@ -1036,6 +1037,9 @@ export class OpenVidu {
|
|||
this.session.onRecoveredConnection();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
logger.warn('There was no previous connection when running reconnection callback');
|
||||
}
|
||||
} else {
|
||||
alert('Connection error. Please reload page.');
|
||||
}
|
||||
|
|
|
@ -987,7 +987,7 @@ export class Session extends EventDispatcher {
|
|||
*/
|
||||
onLostConnection(reason: string): void {
|
||||
logger.warn('Lost connection in Session ' + this.sessionId);
|
||||
if (!!this.sessionId && !this.connection.disposed) {
|
||||
if (!!this.sessionId && !!this.connection && !this.connection.disposed) {
|
||||
this.leave(true, reason);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue