Skip to content

Commit 59ae961

Browse files
committed
Handle nullability
This could interfere with init in queue navigation
1 parent edd1b7d commit 59ae961

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/scripts/page/player.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export const initPlayer = async () => {
9494

9595
player.addEventListener('ended', () => sendMessage(Message.QUEUE_NEXT, null, false));
9696
const handlers = getPlayerController();
97-
handlers.store.subscribe(e => e.qualityLevels, setPlayerQuality);
97+
handlers?.store.subscribe(e => e.qualityLevels, setPlayerQuality);
9898
setPlayerQuality();
9999

100100
const { autoplay, autoplayQueue } = options;
@@ -464,7 +464,7 @@ const getPlayerController = () => {
464464
for (const key of Object.keys(root)) {
465465
if (key.startsWith('__reactProps')) {
466466
for (const child of (root[key] as any).children) {
467-
if (child.props && child.props.playerHandlers)
467+
if (child && child.props && child.props.playerHandlers)
468468
return child.props.playerHandlers as PlayerHandlers;
469469
}
470470
break;

0 commit comments

Comments
 (0)