Skip to content

Commit

Permalink
Fix accessing undefined value in _closeKeySessionInternal
Browse files Browse the repository at this point in the history
  • Loading branch information
dsilhavy committed Aug 7, 2023
1 parent 3bdcc2a commit da4a7b5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/streaming/protection/models/ProtectionModel_21Jan2015.js
Expand Up @@ -403,11 +403,10 @@ function ProtectionModel_21Jan2015(config) {
}

function _closeKeySessionInternal(sessionToken) {
const session = sessionToken.session;

if (!session) {
return
if (!sessionToken || !sessionToken.session) {
return Promise.resolve;
}
const session = sessionToken.session;

// Remove event listeners
session.removeEventListener('keystatuseschange', sessionToken);
Expand Down

0 comments on commit da4a7b5

Please sign in to comment.