From 654f242e92c8b9230e8902f8233a5052c782226d Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Sat, 18 Apr 2020 20:33:51 +0800 Subject: [PATCH] fix minor issue --- src/App.jsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index 5918e5af..a79e5aa3 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -483,6 +483,8 @@ const App = memo(() => { ]); const setCutStart = useCallback(() => { + if (!filePath) return; + // https://github.com/mifi/lossless-cut/issues/168 // If we are after the end of the last segment in the timeline, // add a new segment that starts at playerTime @@ -500,9 +502,11 @@ const App = memo(() => { errorToast(err.message); } } - }, [setCutTime, currentCutSeg, addCutSegment]); + }, [setCutTime, currentCutSeg, addCutSegment, filePath]); const setCutEnd = useCallback(() => { + if (!filePath) return; + try { const endTime = currentTimeRef.current; @@ -514,7 +518,7 @@ const App = memo(() => { } catch (err) { errorToast(err.message); } - }, [setCutTime]); + }, [setCutTime, filePath]); const outputDir = getOutDir(customOutDir, filePath);