Skip to content

Commit

Permalink
fix: avoid crash when seeking to null
Browse files Browse the repository at this point in the history
  • Loading branch information
freeboub committed May 21, 2024
1 parent be681d3 commit f5afaa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Video.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
}, [selectedVideoTrack]);

const seek = useCallback(async (time: number, tolerance?: number) => {
if (isNaN(time)) {
throw new Error('Specified time is not a number');
if (isNaN(time) || time === null) {
throw new Error("Specified time is not a number: '" + time + "'");
}

if (!nativeRef.current) {
Expand Down

0 comments on commit f5afaa8

Please sign in to comment.