Skip to content

Commit e71d486

Browse files
committed
! Avoid using player when it's null (on reload)
1 parent 8afec6e commit e71d486

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/renderer/helpers/player/SabrSchemePlugin.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,6 +653,10 @@ export function setupSabrScheme(sabrData, getPlayer, getManifest, playerWidth, p
653653
// lazily fetch it as the variable is only set after setupSabrScheme is called
654654
// but it will definitely exist when we receive a request here.
655655
const player = getPlayer()
656+
if (player == null) {
657+
// This is true during reload, returning a promise to suppress error
658+
return new AbortableOperation(Promise.resolve())
659+
}
656660
const isAudioOnly = player.isAudioOnly()
657661

658662
const url = new URL(request.uris[0])

0 commit comments

Comments
 (0)