diff --git a/lib/media/drm_engine.js b/lib/media/drm_engine.js index 05971e08ac3..c7549b186bf 100644 --- a/lib/media/drm_engine.js +++ b/lib/media/drm_engine.js @@ -480,8 +480,10 @@ shaka.media.DrmEngine = class { () => this.closeOpenSessions_()); } - const manifestInitData = this.currentDrmInfo_.initData.find( - (initDataOverride) => initDataOverride.initData.length > 0); + const manifestInitData = this.currentDrmInfo_ ? + this.currentDrmInfo_.initData.find( + (initDataOverride) => initDataOverride.initData.length > 0, + ) : null; /** * We can attach media keys before the playback actually begins when: