Fix crash regarding video stream issue

pull/1479/head
Chocobozzz 2018-12-12 08:55:56 +01:00
parent 64e3e27053
commit 9ecac97be0
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 1 deletions

View 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)
})