diff --git a/src/webrtc/call.ts b/src/webrtc/call.ts index eb6a12f62..d1d932744 100644 --- a/src/webrtc/call.ts +++ b/src/webrtc/call.ts @@ -521,6 +521,10 @@ export class MatrixCall extends EventEmitter { } private async collectCallStats(): Promise { + // 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 stats = []; for (const item of statsReport) {