diff --git a/lib/twilio/preflight/preflight.ts b/lib/twilio/preflight/preflight.ts index 2525b3a59..b4388e29e 100644 --- a/lib/twilio/preflight/preflight.ts +++ b/lib/twilio/preflight/preflight.ts @@ -292,7 +292,7 @@ export class PreflightTest extends EventEmitter { const report: PreflightTest.Report = { callSid: this._callSid, edge: this._edge, - iceCandidateStats: this._rtcIceCandidateStatsReport.iceCandidateStats, + iceCandidateStats: this._rtcIceCandidateStatsReport?.iceCandidateStats || [], networkTiming: this._networkTiming, samples: this._samples, selectedEdge: this._options.edge, @@ -302,7 +302,7 @@ export class PreflightTest extends EventEmitter { warnings: this._warnings, }; - const selectedIceCandidatePairStats = this._rtcIceCandidateStatsReport.selectedIceCandidatePairStats; + const selectedIceCandidatePairStats = this._rtcIceCandidateStatsReport?.selectedIceCandidatePairStats; if (selectedIceCandidatePairStats) { report.selectedIceCandidatePairStats = selectedIceCandidatePairStats;