From c80164ccdfd29a8d70d7527b8854867f40f48b5a Mon Sep 17 00:00:00 2001 From: Olivier Bouillet <62574056+freeboub@users.noreply.github.com> Date: Tue, 21 May 2024 22:15:47 +0200 Subject: [PATCH] Fix(ts): crash seeking to null (#3802) * fix: avoid crash when seeking to null --- src/Video.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Video.tsx b/src/Video.tsx index 364c15b1..8fd00486 100644 --- a/src/Video.tsx +++ b/src/Video.tsx @@ -233,8 +233,8 @@ const Video = forwardRef( }, [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) {