Skip to content

Commit 19efcb5

Browse files
committed
Handle video being null in skip notice
Resolves #2201
1 parent 5c7e3b5 commit 19efcb5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/SkipNoticeComponent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -697,7 +697,7 @@ class SkipNoticeComponent extends React.Component<SkipNoticeProps, SkipNoticeSta
697697
getFullDurationCountdown(index: number): () => number {
698698
return () => {
699699
const sponsorTime = this.segments[index];
700-
const duration = Math.round((sponsorTime.segment[1] - getCurrentTime()) * (1 / getVideo().playbackRate));
700+
const duration = Math.round((sponsorTime.segment[1] - getCurrentTime()) * (1 / (getVideo()?.playbackRate ?? 1)));
701701

702702
return Math.max(duration, Config.config.skipNoticeDuration);
703703
};

0 commit comments

Comments
 (0)