From b7756bb26f04235accdd7b1e9a6416bd0135141a Mon Sep 17 00:00:00 2001 From: MosheMaorKaltura Date: Mon, 9 Dec 2024 09:23:01 +0200 Subject: [PATCH] FEC-14226: protect against case where tracks are not ready --- src/player.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player.ts b/src/player.ts index f936860e..ba760c77 100644 --- a/src/player.ts +++ b/src/player.ts @@ -1445,7 +1445,7 @@ export default class Player extends FakeEventTarget { * @private */ private _applyABRRestriction(config: any): void { - if (Utils.Object.hasPropertyPath(config, 'abr.restrictions') && this._engine && this._tracks.length) { + if (Utils.Object.hasPropertyPath(config, 'abr.restrictions') && this._engine && this._tracks?.length) { const { restrictions } = this._config.abr; const videoTracks: VideoTrack[] = this._tracks.filter((track) => track instanceof VideoTrack); const newVideoTracks = filterTracksByRestriction(videoTracks, restrictions);