Fix crash regarding video stream issue
authorChocobozzz <me@florianbigard.com>
Wed, 12 Dec 2018 07:55:56 +0000 (08:55 +0100)
committerChocobozzz <me@florianbigard.com>
Wed, 12 Dec 2018 07:55:56 +0000 (08:55 +0100)
server/helpers/ffmpeg-utils.ts

index 0caa86efcc664739ec51b25f3b27e55658840a6b..c7296054daa6c365af98f2f287322921203b8d9b 100644 (file)
@@ -184,7 +184,7 @@ function getVideoFileStream (path: string) {
       if (err) return rej(err)
 
       const videoStream = metadata.streams.find(s => s.codec_type === 'video')
-      if (!videoStream) throw new Error('Cannot find video stream of ' + path)
+      if (!videoStream) return rej(new Error('Cannot find video stream of ' + path))
 
       return res(videoStream)
     })