Skip to content

Commit

Permalink
fix: null is not an object (evaluating 'n.g.initData')
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstark committed Feb 6, 2023
1 parent c471d23 commit 3f25f35
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/media/drm_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 3f25f35

Please sign in to comment.