From 0090bf85738fedac38caee78768b5c51fe65c46c Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 29 Mar 2017 21:01:14 +0200 Subject: [PATCH] Don't try to seek when no duration Also don't allow cuttin without a valid start/end (yes i removed this earlier) https://github.com/mifi/lossless-cut/issues/10#issuecomment-290183019 --- src/renderer.jsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/renderer.jsx b/src/renderer.jsx index 7e70273a..94dd24e2 100644 --- a/src/renderer.jsx +++ b/src/renderer.jsx @@ -20,6 +20,8 @@ function getVideo() { function seekAbs(val) { const video = getVideo(); + if (val == null || isNaN(val)) return; + let outVal = val; if (outVal < 0) outVal = 0; if (outVal > video.duration) outVal = video.duration; @@ -230,6 +232,9 @@ class App extends React.Component { const cutStartTime = this.state.cutStartTime; const cutEndTime = this.state.cutEndTime; const filePath = this.state.filePath; + if (cutStartTime === undefined || cutEndTime === undefined) { + return alert('Please select both start and end time'); + } if (cutStartTime >= cutEndTime) { return alert('Start time must be before end time'); }