File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed
Frontend/library/src/PeerConnectionController Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @epicgames-ps/lib-pixelstreamingfrontend-ue5.7 " : patch
3+ ---
4+
5+ Add guard against closed ` peerConnection ` in ` generateStats `
Original file line number Diff line number Diff line change @@ -173,9 +173,13 @@ export class PeerConnectionController {
173173 generateStats ( ) {
174174 this . peerConnection ?. getStats ( ) . then ( ( statsData : RTCStatsReport ) => {
175175 this . aggregatedStats . processStats ( statsData ) ;
176-
177176 this . onVideoStats ( this . aggregatedStats ) ;
178177
178+ // Connection might have been closed in the meantime
179+ if ( ! this . peerConnection ) {
180+ return ;
181+ }
182+
179183 // Calculate latency using stats and video receivers and then call the handling function
180184 const latencyInfo : LatencyInfo = this . latencyCalculator . calculate (
181185 this . aggregatedStats ,
You can’t perform that action at this time.
0 commit comments