1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Handle undefined peerconn

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
Šimon Brandner
2021-02-09 14:40:35 +01:00
parent 9f993f1f67
commit 1b22df2b7b

View File

@@ -521,6 +521,10 @@ export class MatrixCall extends EventEmitter {
} }
private async collectCallStats(): Promise<any[]> { private async collectCallStats(): Promise<any[]> {
// This happens when the call fails before it starts.
// For example when we fail to get capture sources
if (!this.peerConn) return;
const statsReport = await this.peerConn.getStats(); const statsReport = await this.peerConn.getStats();
const stats = []; const stats = [];
for (const item of statsReport) { for (const item of statsReport) {